| | |
three JSF questions and (related to Oracle)
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 247
Reputation:
Solved Threads: 0
The name of this question is “three JSF questions”
Hello and Thank you in advance for any assistance.
System info:
Netbeans,MySQL,glassfish
The Purpose of this post is:
have someone look at the excel file (subscribe_app_notes2)at :
http://cid-b5cb457363230793.skydrive...se.aspx/Public
The functionality of this code is:
I have the whole package I am creating (pseudo code) stated there along with 3 questions I am presently trying to figure out.
My question is:
One: I am using MySQL and the tutorial I am studying uses Oracle so I need to resolve the resource tag?
Two: My web.xml is different from the one presented in the tutorial. Could someone point out what needs to be added or changed to get it to work with my project?
Three: One of my classes (TopLinkSubscriberDAO.java) is using imports related to Oracle. I am exploring oracle to resolve this. Is anyone able to explain how to resolve errors in this class?
The errors related to this code are:
Code description:
Thanks again.
-ceyesumma
Note: If you are note willing to look at the exel file that is understandable. I just use it to present every single aspect of the project I am trying to build.
………………………………………………………………………………………………
Code description
Hello and Thank you in advance for any assistance.
System info:
Netbeans,MySQL,glassfish
The Purpose of this post is:
have someone look at the excel file (subscribe_app_notes2)at :
http://cid-b5cb457363230793.skydrive...se.aspx/Public
The functionality of this code is:
I have the whole package I am creating (pseudo code) stated there along with 3 questions I am presently trying to figure out.
My question is:
One: I am using MySQL and the tutorial I am studying uses Oracle so I need to resolve the resource tag?
Two: My web.xml is different from the one presented in the tutorial. Could someone point out what needs to be added or changed to get it to work with my project?
Three: One of my classes (TopLinkSubscriberDAO.java) is using imports related to Oracle. I am exploring oracle to resolve this. Is anyone able to explain how to resolve errors in this class?
The errors related to this code are:
Code description:
JSP Syntax (Toggle Plain Text)
-ceyesumma
Note: If you are note willing to look at the exel file that is understandable. I just use it to present every single aspect of the project I am trying to build.
………………………………………………………………………………………………
Code description
JSP Syntax (Toggle Plain Text)
•
•
Join Date: Aug 2007
Posts: 247
Reputation:
Solved Threads: 0
The name of this question is revised “three JSF questions”
Hello and Thank you in advance for any assistance.
System info:
Netbeans,MySQL,glassfish
Studing tutorial at:
http://www.oracle.com/technology/pub...anu_jsfdb.html
note: hopefully this link is still good.
The Purpose of this post is:
to understand how to resolve with a class with links to oracle toplink DAO and if it is possible to use MySQL databade as apposed to an Oracle database.
The functionality of this code is:
add data to database with JSF
My question is:
One: I am using MySQL and the tutorial I am studying uses Oracle so I need to resolve the resource tag?
Code description: web.xml from the tutorial
Two: My web.xml is different from the one presented in the tutorial. Could someone point out what needs to be added or changed to get it to work with my project?
Code description: My present web.xml
Three: One of my classes (TopLinkSubscriberDAO.java) is using imports related to Oracle. I am exploring oracle to resolve this. Is anyone able to explain how to resolve errors in this class?
Code description: TopLinkSubsriberDAO.java oracle imports
Code description: TopLinkSubscriberDAO.java
The errors related to this code are:
Code description:
Thanks again.
-ceyesumma
Note: If you are note willing to look at the exel file that is understandable. I just use it to present every single aspect of the project I am trying to build.
………………………………………………………………………………………………
Code description
Hello and Thank you in advance for any assistance.
System info:
Netbeans,MySQL,glassfish
Studing tutorial at:
http://www.oracle.com/technology/pub...anu_jsfdb.html
note: hopefully this link is still good.
The Purpose of this post is:
to understand how to resolve with a class with links to oracle toplink DAO and if it is possible to use MySQL databade as apposed to an Oracle database.
The functionality of this code is:
add data to database with JSF
My question is:
One: I am using MySQL and the tutorial I am studying uses Oracle so I need to resolve the resource tag?
Code description: web.xml from the tutorial
JSP Syntax (Toggle Plain Text)
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <context-param> <param-name>adminEmail</param-name> <param-value>admin@localhost</param-value> </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name> <param-value>jdbc/OracleDS</param-value> </context-param> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <servlet> <servlet-name>FacesServlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>FacesServlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> <resource-ref> <res-ref-name>jdbc/OracleDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
Code description: My present web.xml
JSP Syntax (Toggle Plain Text)
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file>subscribe/welcomeJSF.jsp</welcome-file> </welcome-file-list> </web-app>
Three: One of my classes (TopLinkSubscriberDAO.java) is using imports related to Oracle. I am exploring oracle to resolve this. Is anyone able to explain how to resolve errors in this class?
Code description: TopLinkSubsriberDAO.java oracle imports
JSP Syntax (Toggle Plain Text)
package jsfdb.model.dao; import jsfdb.model.LoginInfo; import jsfdb.model.Subscriber; import jsfdb.model.ModelUtils; import jsfdb.model.err.IncorrectPasswordException; import jsfdb.model.err.LoginException; import jsfdb.model.err.ProfileException; import jsfdb.model.err.SubscribeException; import jsfdb.model.err.UnknownSubscriberException; import jsfdb.model.err.UnsubscribeException; import oracle.toplink.expressions.ExpressionBuilder; import oracle.toplink.queryframework.ReadObjectQuery; import oracle.toplink.sessions.Session; import oracle.toplink.sessions.UnitOfWork; import oracle.toplink.threetier.ClientSession; import oracle.toplink.threetier.Server; import oracle.toplink.tools.sessionmanagement.SessionManager;
Code description: TopLinkSubscriberDAO.java
JSP Syntax (Toggle Plain Text)
package jsfdb.model.dao; import jsfdb.model.LoginInfo; import jsfdb.model.Subscriber; import jsfdb.model.ModelUtils; import jsfdb.model.err.IncorrectPasswordException; import jsfdb.model.err.LoginException; import jsfdb.model.err.ProfileException; import jsfdb.model.err.SubscribeException; import jsfdb.model.err.UnknownSubscriberException; import jsfdb.model.err.UnsubscribeException; import oracle.toplink.expressions.ExpressionBuilder; import oracle.toplink.queryframework.ReadObjectQuery; import oracle.toplink.sessions.Session; import oracle.toplink.sessions.UnitOfWork; import oracle.toplink.threetier.ClientSession; import oracle.toplink.threetier.Server; import oracle.toplink.tools.sessionmanagement.SessionManager; public class TopLinkSubscriberDAO implements SubscriberDAO { private Server serverSession; public TopLinkSubscriberDAO() { SessionManager manager = SessionManager.getManager(); String id = ModelUtils.getResource("TopLinkSession"); ClassLoader loader = this.getClass().getClassLoader(); serverSession = (Server) manager.getSession(id, loader); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { serverSession.logout(); SessionManager.getManager().getSessions().remove( ModelUtils.getResource("TopLinkSession")); } }); } private ClientSession acquireClientSession() { return serverSession.acquireClientSession(); } private UnitOfWork acquireUnitOfWork() { return acquireClientSession().acquireUnitOfWork(); } private Subscriber read(Session session, String email) { ReadObjectQuery query = new ReadObjectQuery(Subscriber.class); ExpressionBuilder builder = new ExpressionBuilder(); query.setSelectionCriteria(builder.get("email").equal(email)); return (Subscriber) session.executeQuery(query); } public Subscriber select(LoginInfo loginInfo) throws LoginException, UnknownSubscriberException, IncorrectPasswordException { Subscriber s = null; try { ClientSession session = acquireClientSession(); s = read(session, loginInfo.getEmail()); } catch (Exception x) { ModelUtils.log(x); throw new LoginException(); } if (s == null) throw new UnknownSubscriberException(); if (!s.getPassword().equals(loginInfo.getPassword())) throw new IncorrectPasswordException(); return s; } public void insert(Subscriber subscriber) throws SubscribeException { try { UnitOfWork uow = acquireUnitOfWork(); Subscriber s = new Subscriber(); ModelUtils.copy(subscriber, s); uow.registerObject(s); uow.commit(); } catch (Exception x) { ModelUtils.log(x); throw new SubscribeException(); } } public void update(Subscriber subscriber) throws ProfileException { try { UnitOfWork uow = acquireUnitOfWork(); Subscriber s = read(uow, subscriber.getEmail()); ModelUtils.copy(subscriber, s); uow.commit(); } catch (Exception x) { ModelUtils.log(x); throw new ProfileException(); } } public void delete(Subscriber subscriber) throws UnsubscribeException { try { UnitOfWork uow = acquireUnitOfWork(); Subscriber s = read(uow, subscriber.getEmail()); uow.deleteObject(s); uow.commit(); } catch (Exception x) { ModelUtils.log(x); throw new UnsubscribeException(); } } }
The errors related to this code are:
Code description:
JSP Syntax (Toggle Plain Text)
-ceyesumma
Note: If you are note willing to look at the exel file that is understandable. I just use it to present every single aspect of the project I am trying to build.
………………………………………………………………………………………………
Code description
JSP Syntax (Toggle Plain Text)
![]() |
Similar Threads
- Questions about animation techniques! (Game Development)
- Can't find Oracle JDBC Driver (Java)
- Questions For WebDevelopment =) (HTML and CSS)
- vBulletin mod_rewrite (PHP)
- Problems with JSTL (JSP)
- Today's Posts is now forum specific (DaniWeb Community Feedback)
- Mobility Radeon is Unstable (Windows NT / 2000 / XP)
Other Threads in the JSP Forum
- Previous Thread: dynamic table in jsp
- Next Thread: Session Expire
Views: 654 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for JSP
action apache array backbutton books boonex combobox comma connection csv database debugging development directorystructure dropdownlist dynamicpagetitles eclipse examples excel form forward frames generating glassfish ie8 image2database imagestoring imagetodatabase imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mime-rfc multiple mvc2 mvcmodel2 mysql netbeans network non-standard-mime objects open parameters passing ping printinserverinsteadofclient project quickguide read redirect request.getparameter resorces response resultset seperated servlet servletdopost()readxml sessions social software source sql ssl standard-mime state_saving_method stocks sun tomcat tutorial unique update values video web write





