Accessing pageContext in a bean

I want to access the pageContext in a bean. please tell me how to do it...
Thanks in advance...

Pass the PageContext in to the Bean:
<jsp:useBean id="myBean" scope="session" class="MyBean" />     
<% myBean.setPageContext(pageContext); >
and in MyBean:
public class MyBean {
  javax.servlet.jsp.PageContext pageContext;
  public void setPageContext(javax.servlet.jsp.PageContext inPageContext) {
        this.pageContext = inPageContext; }
....etc

Similar Messages

  • Error in accessing pageContext or current session for JSP/servlet in frames

    I am creating a web application on iPlanet application server (ver 6.0 SP4) and display a page
    consists of frames in web browser (IE6). The framset and the content of each frames are
    JSPs or servlets. There where no problem to display each content frames individually at all.
    However, when the overall page (the frame set and the 3 frames) is displayed, the following
    problem occurs.
    Only the outermost frameset and just one or two of the frame contents displayed successfully
    in browser. Others have either 1 of the following errors:
    1. When accessing pageContext object in _jspService routine when displaying the JSP page, Null
    Pointer Exception occurs:
    java.lang.NullPointerException
    Exception Stack Trace:
    java.lang.NullPointerException
    at jsp.APPS.intl.acct_type_option._jspService(acct_type_option.java:653)
    2. When calling the req.getSession method in doGet() method for servlets, the following
    exception occurs:
    Exception in doGet(): This session has already been invalidated
    The occurance of error is random among all the frames. With the frame on top or left size
    having the most chance to be displayed successfully.
    It seems that the Application server cannot entertain 3 or 4 requests simultaneously (which
    happens when displayed a page consists of frames), having some of them throw an exception.
    Are they any tuning or setting for iPlanet server to overcome this problem?

    I'll give you the same advice as I have been given regarding the use of frames.
    Don't use them at all. Use scrollable DIV's instead.
    The use of frames is such that you would have different JSP's who cannot collaborate together since each is in his own frame and does not know about the others.
    In case I'm mistaken, I'd like to hear about it, but the combination of JSP's and frames is an unhappy one.

  • Few basic doubts about accessing AM from backing bean class

    Hi ADF experts,
    I have just started working in ADF Faces.I made a sample search page.My page is attached to a managed backing bean. I have attached command button on my page to a custom method in backing bean class.
    So on, click of button this method is called in backing bean.Now, i have few doubts:
    1)How to get values of various UI beans in this event code?
    2)I am accesing AM , in my method with this code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext = facesContext.getExternalContext();
    Application app = facesContext.getApplication();
    DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(facesContext, "bindings");
    //Accessing AM
    ApplicationModule am = binding.getDataControl().getApplicationModule();
    iS this correct ?
    3) After getting handle of am how to call my custom method in AM Class?there was "invokeMethod" API in application module class in OAF, is there any such method here?
    Please help me.
    --ADF learner.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for ur response Frank, actually I am from OA Framework back ground.It would be great if help us a little with ur valuble thoughts.
    OA Framework also uses bc4j in model layer of framework. We have a requirement where our existing developers from OA Framework have to move to ADF to make a new application where time lines are quite strict.If this would not be possible we will switch to plain jsp and jdbc,but our tech experts say ADF Faces is the best tech.
    In OA Framework, Application Module is key class for all busiess logic and Controller is used for page navigation. So, I m just trying to find the same similarity , where we write we add all event codes in custom action methods in the backing bean class of page, which we consider equivalent to process form request method in Controller class of OAF.
    But there are two things, I still want to know:
    1)While page render, how to call specific AM methods(like setting where clause of certain VOs)
    2)In action methods, the way i described(I found that in one thread only)to access AM, what is wrong in that?Also, I went through
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    where coule of examples use similar approach to access AM from backing bean class and call custom methods of AM(Doing various, deletes etc from VOs).
    3)In these methods can we set any property of beans on the page, I am asking because in OAF, generally we use PPR for js alternatives.But all properties of beans cannot be set in post event.
    Thanks and Regards
    --ADF Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Database access from Managed/Backing bean

    Hi,
    I would like to authenticate web users from a database table, I get the account details
    in the Welcome page, I wish to check if the user exists in the table (from the managed bean), how do I do this?
    Is this good practice to access the db from managed bean? If not how do I do this in model component and pass the value back and forth from managed bean?
    Thanks,
    Jai.

    Hi
    You can get all the information of logged in user from SecurityContext(you can get this either from ADFContext using ADFContext.getCurrent().getSecurityContext() or using EL expression eg. #{securityContext.userName} shows logged in user name)
    API: http://download.oracle.com/docs/cd/E15051_01/apirefs.1111/e10686/oracle/adf/share/security/SecurityContext.html#method_summary
    More details on enabling security: http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/adding_security.htm#BGBCEDDD
    Sireesha

  • I want to have access from my backing bean to attributes

    Hi,
    I have a table PERSON with the columns ID (PK), FIRST_NAME, LAST_NAME and SALUTATION_ID (FK).
    I have a second table SALUTATION with the columns ID and NAME.
    I do use the following lines of code if I want to make changes to the PERSON table and it works fine.
    DCBindingContainer dcBind = (DCBindingContainer)getBindings();
    DCIteratorBinding iterBind = (DCIteratorBinding)dcBind.get("PersonCollectionIterator");
    iterBind.getCurrentRow().setAttribute("FIRST_NAME", "Tobias");
    dcBind.getOperationBinding("mergeEntity").execute();
    My problem is, that I can't change the SALUTATION_ID of PERSON. I don't have access to that attribute. I did use the following line of code to print out all the available attributes and it only showed ID, FIRST_NAME and LAST_NAME.
    iterBind.getCurrentRow().getAttributeNames()
    What could I do?
    Thank You
    Tobias

    Hi!
    I assume that you use EJBs. Then, you have no foreign keys in your parent entity (Person). Instead you have a mapping to the related entity (Salutation) by which you can access a salutation for a person like this (I'm using EL for simplicity):
    Person p = resolve("#{PersonCollectionIterator.currentRow.dataProvider}");
    Salutation s = p.getSalutation();
    and you can set a salutation by:
    p.setSalutation(newSalutation);
    where newSalutation is an salutation entity you somehow retrieved from your model. For example, if you enter salutation ID in text box on your page, then in backing bean button action listener you should call findSalutationById method in Fascade which returns a newSalutation entity and then set that new salutation as above. After that, you have a new salutation mapped to person and you can invoke mergeEntity on you Fascade.
    Hope this helps.
    PaKo

  • Access ComponentId in Back Bean

    Hello,
    I have the jsp :
    <h:outputText id="One" value="#{myBean1.textValue}"/>
    <h:outputText id="One" value="#{myBean1.textValue}"/>
    The Error is :
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Component ID 'One' has already been used in the view.
    See below for the view up to the point of the detected error.
    +id: j_id_id25
    type: javax.faces.component.UIViewRoot@1e6d7b6
    +id: j_id_id27
    type: javax.faces.component.html.HtmlForm@5c1eea
    +id: j_id0
    type: javax.faces.component.html.HtmlOutputText@1f1ab66
    +id: j_id1
    type: javax.faces.component.html.HtmlOutputText@12be098
    +id: One <===============
    type: javax.faces.component.html.HtmlOutputText@1a62b24
    How an I access the Id in my Back Bean? Obviously the Id has to be different. If I set the Id's to "One" and "Two", how can I access these Values?
         FacesContext context = FacesContext.getCurrentInstance();
         System.out.println(context.getViewRoot().getId());
    prints only the "j_id_id25" ....
    thx

    Hello,
    the basic functionallity should be :
    1. on a table all messages, labels and other infos are stored. That works fine, read with JPA works perfect
    2. on the jsp I refer with an Id to that table and read the value from that table
    3. displaying that readen value
    the The BalusC Code works fine, as long the myBean.text is unique.
    <h:outputText binding="#{myBean.text}" value="#{myBean.textValue}">
    <f:attribute name="attributename" value="attributevalue" />
    </h:outputText>
    using the same code twice on the jsp does not work, as you posted earlier.
    so after all I am looking for a solution similar to that code, but I want to use only one method and parse parameters so I can read the wanted value from the table ...
    I thought, differenciate with the Id like
    <h:outputText id="Id1" value="#{myBean1.textValue}"/>
    <h:outputText id="Id2" value="#{myBean1.textValue}"/>
    could bring me to my solution. if i could read the component Id "Id1" I cann access the database depending on that Id .... then I could use the same outputText with different id ...
    hope you can help me ...

  • How to access Message bundle from beans??

    Greetings i am new to JSF.
    I want to access my message bundle from beans, anyone could tell me how to do it?
    Also, i need my beans to obtain the url address of my servlet automatically, how can i do that?
    Thanks for any help!

    Another alternative if using the <f:loadBundle> tag within your JSP is to do something like the following in your bean logic:
    In a JSP:
    <f:loadBundle basename="Resources" var="messages"/>
    In Bean:
    ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();
    // Obtains the Map containing the key/value pairs loaded by the loadBundle tag
    Map messages = (Map) extContext.getRequestMap().get("messages");
    As to the second question, I'm assuming you want the URL that invoked the current request? If so, look at ExternalContext.getRequestPathInfo() and ExternalContext.getRequestServletPath().

  • Updating a Access Database via a Bean

    I�m having a problem using a java bean to update the contents of a database. I receive the error message:
    Cannot find a method to read property 'firstname' in a bean of type 'myBeans.UpdateGuestBean'
    I have an html form embedded in a jsp page as follows:
    <FORM NAME="members" ACTION="members.jsp"
          METHOD="POST">
        <TABLE BORDER="1" WIDTH="50%" ALIGN="center" BGCOLOR="lightgreen" CELLPADDING="2">
        <TR>
             <TD WIDTH="25%"><B>Firstname:</B></TD>
             <TD WIDTH="25%"><INPUT TYPE="text" SIZE="25" NAME="firstname" VALUE="<%= firstname %>"></TD>
        </TR>
        <TR>
             <TD><B>LastName:</B></TD>
             <TD><INPUT TYPE="text" NAME="surname" SIZE="25" VALUE="<%= surname %>"></TD>
        </TR>
        <TR>
             <TD><B>Email:</B></TD>
             <TD><INPUT TYPE="text" NAME="email" SIZE="25" VALUE="<%= email %>"></TD>
        </TR>
             <TD COLSPAN="2" ALIGN="right" WIDTH="50%"><INPUT TYPE="submit" VALUE="Update"></TD>
        </TR>I then call on members.jsp
    <%@ page language="java" contentType="text/html" errorPage="errorpage.jsp" %>
    <HTML>
    <HEAD><TITLE>Order Form</TITLE></HEAD>
    <BODY>
    import java.sql.*;
    <jsp:useBean id="members" class="myBeans.UpdateGuestBean" />
    <jsp:setProperty name="members" property="*"/>
    <ul>
    <li>first: <jsp:getProperty name="members" property="firstname" />
    <li>secondname: <jsp:getProperty name="members" property="surname" />
    <li>email: <jsp:getProperty name="members" property="email" />
    </ul>
    <% members.updateDatabase(); %>
    <jsp:forward page="confirmation.jsp" />
    </BODY>
    </HTML>Finally calling my java bean:
    package myBeans;
    import java.sql.*;
    class UpdateGuestBean
      //declare variables
      private String firstname;
      private String surname;
      private String email;
      //set methods
      public void setfirstname(String inputFirstname)
        this.firstname=inputFirstname;
      public void setsurname(String inputSurname)
        this.surname=inputSurname;
      public void setemail(String inputEmail)
        this.email=inputEmail;
      public void makeChanges(String email)
        try
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
          Connection conn = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/Tomcat/jakarta-tomcat-4.1.31/webapps/ROOT/MyDB.mdb","","");
          Statement statement = conn.createStatement();
          String sql = "UPDATE members SET MyDB.Firstname='" + this.firstname + "' WHERE Username ='" + email + "';";
          statement.executeUpdate(sql);
          if (statement != null) statement.close();
          if (conn != null) conn.close();
        catch(Exception e)
          System.out.println("My error: " + e);
    }Help! I�ve run out of ideas. For a reminder, the error message is
    Cannot find a method to read property 'firstname' in a bean of type 'myBeans.UpdateGuestBean'
    Thanks in advance.

    Thanks for that. I put the getter methods in and it resolved that error message, however now I get a new error message:
    cannot resolve symbol
    symbol: method updateDatabase ()
    location: class myBeans.UpdateGuestBean
    members.updateDatabase();
    ^
    Any ideas? I think its referring to the jsp file members.jsp:
    <%@ page language="java" contentType="text/html" errorPage="errorpage.jsp" %>
    <HTML>
    <HEAD><TITLE>Order Form</TITLE></HEAD>
    <BODY>
    import java.sql.*;
    <jsp:useBean id="members" class="myBeans.UpdateGuestBean" />
    <jsp:setProperty name="members" property="*"/>
    <ul>
    <li>first: <jsp:getProperty name="members" property="firstname" />
    <li>secondname: <jsp:getProperty name="members" property="surname" />
    <li>email: <jsp:getProperty name="members" property="email" />
    </ul>
    <% members.updateDatabase(); %>
    <jsp:forward page="confirmation.jsp" />
    </BODY>
    </HTML>

  • How can a session scope bean access an application scope bean - help

    Hello,
    I have a JSP page that has references to an Application Scope and a Session Scope bean...
    <jsp:useBean id="myWebApp" scope="application" class="com.my.web.WebApplication" />
    <jsp:useBean id="myWebSession" scope="session" class="com.my.web.WebSession" />
    I would like the WebSession access methods in the WebApplication ... Can/ How does the WebSession object lookup the reference to WebApplication object?

    I don't think you should make the WebSession implement the session listener.
    The session listener will be created once, at the start of the servlet context and would be listening to all sessions. So you would have one instance of the WebSession belonging to the context (though not as an attribute), and others belonging to each session. This will be confusing in your code, I think.
    I would suggest having a different class act as the HttpSessionListener. Perhaps do something like this:
    public class WebSessionInjector implements HttpSessionListener {
      public void  sessionCreated(HttpSessionEvent e) {
        WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
        WebSession mySession = new WebSession();
        mySession.setWebApplication(webApp);
        e.getSession().setAttribute("mySession", mySession);
      public void sessionDestroyed(HttpSessionEvent e) { ... }
    }You may be able to use the WebApplication object itself as the listener ...
    Or, you could make the WebSession implement the HttpSessionBindingListener and use the valueBound event much like the sessionCreated event above, but from inside the WebSession object:
    public class WebSession implements HttpSessionBindingListener {
      public void  valueBound(HttpSessionBindingEvent e) {
        WebApplication webApp = (WebApplication)(e.getSession().getServletContext().getAttribute("webapp"));
        this.setWebApplication(webApp);
      public void valueUnbound(HttpSessionBindingEvent e) { ... }
    }

  • Accessing add() methods through bean properties ?!

    I hope this question is trivial...
    Is there a defined way of using add(*) methods through bean properties ?
    Seems a little odd that Swing components can't be added to a container in a simple "bean-like" way....is there a set*(*) method I've missed ? I'm aware of the getComponents() method on Container...but there's no setComponents(Component []) method.
    Thanks,
    Michael.

    Thank you for the repsonse....but..
    Wouldn't that mean that I'd have to sub-class all the Components I wanted to use....just to add the set*(*) method....isn't there a tidier way ?
    I really find this strange...(I can think of many examples where accessing the add*(*) methods through introspection (possibly by providing set*(*) methods) would be extremely useful....but, staying in a Swing context....)
    If you wanted to create an application that can load, edit and save GUI forms (as many already have). Having all Swing components stick to the javaBeans spec. is very useful. The application can use introspection to grab all the properties of a component, without having any hard-coded logic on dealing with specific classes. Users can then provide their own extensions to the components palette, and by sticking to the javaBeans convention, have the GUI editor expose those properties.
    But....to compose components together (a fundamental concept) the editor must be provided with "hard-coded" logic that knows how to deal specifically with Components (in that they have an add(*) method).
    This must also be a problem with the XMLDecoder class ?!
    When encoding a Swing component, the XMLEncoder can use all the get*() methods (including getComponents()) to persist the Container, its properties, and any sub-components....fine.
    But, when decoding this information, all the properties can be set through the usual bean mechanism (using the corresponding setPropertyName(*) method) except the sub-components....there is no setComponents(*) method.
    How does the XMLDecoder get around this problem ?
    Does it "know" that when it gets to the "components" property of a Swing component, it must call the add(*) method instead...?
    Thanks,
    Michael

  • Running netscape servlet access a weblogic deployed bean

    I an having problems creating the initialcontext object when tring to access a
    bean deployed in
    Weblogic6.0 from a servlet running in netscape Iplanet server. Has anyone every
    got this to work?
    Is this a valid configuration or does the servlet have to be running in the weblogic
    server.
    Thanks Doug

    I an having problems creating the initialcontext object when tring to access a
    bean deployed in
    Weblogic6.0 from a servlet running in netscape Iplanet server. Has anyone every
    got this to work?
    Is this a valid configuration or does the servlet have to be running in the weblogic
    server.
    Thanks Doug

  • RE: Accessing a CMP Entity Bean

    Hi There,
    I have written a couple of CMP entity beans. When I run the client application, I am getting a ORB minor code 257. The error message follows. My code works with both BMP entity beans and session beans. Can anyone help? Thanks in advance.
    Aug 21, 2005 10:24:57 PM com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
    WARNING: "IOP00810257: (MARSHAL) Could not find class"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
         at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7987)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
         at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
         at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
         at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
         at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
         at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)
    Caused by: java.lang.ClassNotFoundException
         ... 27 more
    org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
         at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:365)
         at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:353)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
         at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
         at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
         at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
         at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
         at ctaejb.entitybean.order._IOrderHome_DynamicStub.findByPrimaryKey(_IOrderHome_DynamicStub.java)
         at mainapp.CTestApplication.main(CTestApplication.java:32)

    This is probably not the best forum to get an answer. Try this one instead:
    http://forum.java.sun.com/forum.jspa?forumID=13
    Its difficult to know exactly the source of your problem. If your code works for session beans and Entity beans using BMP then I can only think of the following:
    In a CMP Bean, the ejbLoad and ejbStore methods do nothing. The container performs the load and store for you. I don't know whether leaving code in these methods will cause any problems though.
    You will need to make a few changes to your ejbCreate method though. Suppose your ejbCreate method looks like this:
    public PersonKey ejbCreate(String aFirstName, String aLastName) You still need to initialise the firstName and lastName fields in the bean.
    firstName = aFirstName;
    lastName = aLastName;Normally, the ejbCreate method returns the key value for the created object. Using CMP, you must return null. The container generates the new key value and returns it to the client.
    Not sure if that will help. Post on the link above if not.
    Simon

  • Database access design using java bean

    Hi,
    I am writing a JSP/servlet/Javabean based app. using MVC architecture.The database related logic is in java beans.
    I want a generalized class/bean that can form a connection , execute the passed query and return the results.Does any one has any URLs or sample code to explain how to do this using introspection?
    I would greatly appreciate any help as this design is very crucial for our application.
    Thanks -
    k

    Please check the Cameleon Open Source project at http://www.must.de/cameleon.html if ti fits your needs.

  • SQL exception thrown while accessing fields through the bean

    Hi All
    This is the SQL Exception that i get when i try to get the data from the database ---java.sql.SQLException: ORA-01008: not all variables bound
    Plz help if u have any idea.
    Thanx and regards,
    Akshat

    It seems like you have set the number of parameters in a PreparedStatement less than the actual number of parameters. This is one possibility.
    Regards,
    $ Carol.

  • Benefit using intermediate data-access obj btwn entity bean & data resource

    Hei to all,
    can anyone help me .
    Thanks for your valuable time.
    regards,
    manix

    A reduction in the amount of remote method invocations would be a start in improving performance of your applications. (ie get/sets performed on local object in lieu of remote object)

Maybe you are looking for

  • My browser window disappeared.

    HELP!  The first time I opened my Safari browser after installing Maverick, I clicked on the wrong thing & closed my browser window where you search & the web addresses show up & where you can refresh the page.  How do I reopen it so i don't have to

  • I need help with changing my e-mail. I just made this account today and I want to delete it or change the e-mail. Help would be very nice!

    Hello can you tell me how to terminate my account(DELETE IT!) or change the e-mail. I went to privacy setting and my e-mail was shown, but nothing about changing it. I went to profile settings and there was nothing about deleting it so any help would

  • Digital camera dslr to Ipad air

    Ive just bought an Ipad Air and would like to connect my digital camera to it. I see there used to be a connection kit for the previous models but is there a way that I can connect to the Ipad? Is a usb connection a possibility? I use a Nikon D3s and

  • DW CS4: FLV video not displaying

    I'm using Dreamweaver CS4 and I'm trying to put an FLV video on a page. I used Insert ->Media ->FLV... and filled in everything it asked for - I browsed for the video (which is in my root directory), I chose a skin, and I input width and height value

  • Help please! How would i know if a day is within a range of dates?

    Hi everyone! I'm new to java. I just want to ask for help about date manipulation. My situation is this: In a given company, they set their own first-day-of-the-week. And this first-day-of-the-week may change from time to time. Given a calendar, you