Unable to call bean method at second JSP.

I have a Bean called "Database" in that two methods
1.public String methodReturnsString()
2.public List methodReturnsList()
And also i have three jsp's.
1.First.jsp
2.Success.jsp
3.fail.jsp
i called methodReturnsString of "Database" in the First.jsp ,after receiving intended String from the method methodReturnsString() i.e "success" or "fail" i can goto Success.jsp. or fail.jsp.
Assume i got String "success" eventually leads me to Success.jsp , In this Success.jsp i was trying to access Bean method methodReturnsList() , Now the problem is I cant access the Bean method methodReturnsList() in Success.jsp, where i want to print the List that is returned by methodReturnsList().
Can anybody tell me what is the mistake i am doing.
here is "Success.jsp"
<%@ page contentType="text/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
Login Successful
<html>
<f:view>
   <h:form id="result">
     <p>
             <c:forEach var="x" items="${Database.methodWithList}" >
          ${x}
     </c:forEach>
            </p>
       </h:form>
</f:view>
</html>here is" Faces-config.xml"
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
     <managed-bean>
          <managed-bean-name>Database</managed-bean-name>
          <managed-bean-class>com.persistent.parashar.database.Database</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
     </managed-bean>
     <navigation-rule>
          <from-view-id>/First.jsp</from-view-id>
          <navigation-case>
               <from-action>#{Database.methodReturnsString}</from-action>
               <from-outcome>success</from-outcome>
               <to-view-id>/success.jsp</to-view-id>
          </navigation-case>
          <navigation-case>
               <from-action>#{Database.methodReturnsString}</from-action>
               <from-outcome>fail</from-outcome>
               <to-view-id>/fail.jsp</to-view-id>
          </navigation-case>
     </navigation-rule>
</faces-config>
Here is Database.java
public class Database {
     public List methodWithList()
          System.out.println("Contents in the List#########");
          List al=new ArrayList();
          al.add("jaya");
          al.add("chandra");
          al.add("raheem");
          al.add("balu");
          System.out.println("Contents in the List"+al);
          return al;
     public String methodReturnsString()
          return "success";
}

Thank you for reply, after making few chages by taking your suggestion i am still struggling to get the desired result in my jsp. please into the code below
public class Database {
        public List calToDatabase;
     public static void initialCalToList()
          System.out.println("Contents in the List#########");
          List al=new ArrayList();
          al.add("JAya");
          al.add("chandra");
          al.add("raheem");
          al.add("balu");
          System.out.println("Contents in the List"+al);
          Database db= new Database();
          db.setCalToDatabase(al);  // calling the setter with list as an argument
public List getCalToDatabase() {
          return calToDatabase;
     public void setCalToDatabase(List calToDatabase) {
          this.calToDatabase = calToDatabase;
     }I have also made changes in success.jsp
<%@ page contentType="text/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
Login Successful
<html>
<f:view>
   <h:form id="result">
     <p>
           <c:forEach var="x" items="#{Database.getCalToDatabase}" >
                 ${x}
               </c:forEach>
     </p>
   </h:form>
</f:view>
</html>

Similar Messages

  • How to call a void bean method in a jsp ?

    I want to call a bean method from the jsp page. The method is void i.e it returns nothing.
    Lets say the bean id is mybean and the method name is beanmethod( ). I want to know in what type of jsp tags should I put mybean.beanmethod( ). Using jsp expression <%= mybean.beanmethod( ) %> gives error and so does scriptlet <% mybean.beanmethod( ) %>
    Can someone help me out. Thanx.
    Arshad

    did you already implement this?
    <jsp:useBean id="mybean" class="yourPackage.YourBean scope="session"/>
    use ";" at the end:
    <% mybean.beanmethod(); %>

  • How to call a method in one JSP from another JSP?

    say that I have 2 JSPs.
    JSP one has a button.
    JSP two has some method that, say, find the square root of the number passed from JPS one.
    How to - when click - the button on page one call the method on page two?
    Please note that I can not use object binding, but I want passing the actual parameter and call the method on page two.
    Please note that this is an update of a previous post on the same topic called "Object scope".
    Thank you all very much.

    No, i dont know how to call other than main methods from other classes
    And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch).........

  • Unable to call Action Method of the Backing Bean

    I have created a jsf page with several tables and input text boxes. I also have the command button to submit the values to the backing bean but, the action method "saveBean()" is not being called
    Hear are the codes listed below listed
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <h:form id="myBioDataForm">
    <h:panelGrid columns="2" >
              <h:panelGroup  >
                   <h:outputLabel id="NameLabel" value="Name" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:inputText id="NameTextBox" value="#{bioData.objBioDataVo.name}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="DOBLabel" value="DOB" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <t:inputCalendar id="DOBCalendar" renderAsPopup="true"  value="#{bioData.objBioDataVo.doB}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="AddressLabel" value="address" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:outputLabel value=""/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="Street" value="Street" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:inputText id="StreetTextBox" value="#{bioData.objBioDataVo.street}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="City" value="Town/City" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:inputText id="CityTextBox" value="#{bioData.objBioDataVo.city}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="Pincode" value="Pincode" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:inputText id="PincodeTextBox" value="#{bioData.objBioDataVo.pincode}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="Mobile" value="Mobile" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:inputText id="mobileTextBox" value="#{bioData.objBioDataVo.mobile}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="Email" value="Email" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:inputText id="emailTextBox" value="#{bioData.objBioDataVo.email}"/>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="Gender" value="Gender" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:selectOneRadio value="#{bioData.objBioDataVo.gender}">
                        <f:selectItem itemLabel="Male" itemValue="Male"/>
                        <f:selectItem itemLabel="Female" itemValue="Female"/>
                   </h:selectOneRadio>
              </h:panelGroup>
              <h:panelGroup  >
                   <h:outputLabel id="Marital_Status" value="Marital Status" style="font-size: medium"/>
              </h:panelGroup>
              <h:panelGroup >
                   <h:selectOneRadio value="#{bioData.objBioDataVo.status}">
                        <f:selectItem itemLabel="Married" itemValue="Married"/>
                        <f:selectItem itemLabel="UnMarried" itemValue="UnMarried"/>
                   </h:selectOneRadio>
              </h:panelGroup>
    </h:panelGrid>
    <f:verbatim><br><br><br></f:verbatim>
         <h:dataTable var="item" value="#{bioData.al}">
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="No Of Years"/>
              </f:facet>
                   <h:selectOneMenu id="NoYears1" value="#{item.noYears}">
                   <f:selectItems value="#{item.noYearsVoTM}"/>
              </h:selectOneMenu>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Organisation"/>
              </f:facet>
                   <h:inputText id="OrgnisationTextBox" value="#{item.orgVo}"/>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Designation"/>
              </f:facet>
                   <h:inputText id="designationTextBox" value="#{item.desigVo}"/>
              </h:column>
         </h:dataTable>
                   <h:commandButton id="addRow" type="submit" value="Add Row" immediate="true" action="#{bioData.addStr}"/>
                   <h:dataTable  var="edual" value="#{bioData.eduList}">
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Year of Passing"/>
              </f:facet>
                   <h:selectOneMenu id="NoYears11" value="#{edual.yearPassing}">
                   <f:selectItems value="#{edual.yearPassingTM}"/>
              </h:selectOneMenu>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Qualification"/>
              </f:facet>
                   <h:selectOneMenu id="NoYears11" value="#{edual.qualification}">
                   <f:selectItems value="#{edual.qualificationTM}"/>
              </h:selectOneMenu>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Specialisation"/>
              </f:facet>
                   <h:inputText id="SpecialisationTextBox1" value="#{edual.specialisation}"/>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Specialisation"/>
              </f:facet>
                   <h:inputText id="SpecialisationTextBox1" value="#{edual.specialisation}"/>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="School"/>
              </f:facet>
                   <h:inputText id="SchoolTextBox1" value="#{edual.school}"/>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Total Marks"/>
              </f:facet>
                   <h:inputText id="MarksTextBox1" value="#{edual.cgpa}"/>
              </h:column>
         </h:dataTable>
                   <h:commandButton id="addRow1" type="submit" value="AddRow" immediate="true" action="#{bioData.addEdu}"/>
         <h:dataTable var="str" value="#{bioData.strList}">
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="sno"/>
              </f:facet>
                   <h:inputText id="snoTextBox" value="#{str.sno}"/>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Stengths"/>
              </f:facet>
                   <h:inputText id="StengthsTextBox" value="#{str.strengths}"/>
              </h:column>
              <h:column>
              <f:facet name="header" >
                   <h:outputText value="Weaknesses"/>
              </f:facet>
                   <h:inputText id="WeaknessesTextBox" value="#{str.weaknesses}"/>
              </h:column>
         </h:dataTable>
                   <h:commandButton id="addRow2" type="submit" value="Add Row" immediate="true" action="#{bioData.addWks}"/>
              <h:outputLabel id = "saveLabel" value="Enter Name"/>
              <h:inputText id="saveTextBox" value="#{bioData.bioName}"/>     
              <h:commandButton id="savebutton" type="submit" value="Save"  action="#{bioData.saveBio}"/>
    </h:form>----------------------------Backing Bean--------------------------------------
    package com.minerva.trainees;
    import java.util.HashMap;
    public class BioDataHomeBackingBean
         String selectBio;
         HashMap selectBioHM;
         public BioDataHomeBackingBean() {
              selectBioHM = new HashMap();
              selectBioHM.put("Create BioData", "Create BioData");
         public String processBioData()
              String select_tmp = getSelectBio();
              String action="";
              if(select_tmp.equalsIgnoreCase("Create BioData"))
                   action= "displayCompetency@rgsRequest";
              return action;
         public String saveBio() throws Exception
              System.out.println("########################Inside saveBio##################");
              return "success";
         public String getSelectBio() {
              return selectBio;
         public void setSelectBio(String selectBio) {
              this.selectBio = selectBio;
         public HashMap getSelectBioHM() {
              return selectBioHM;
         public void setSelectBioHM(HashMap selectBioHM) {
              this.selectBioHM = selectBioHM;
    managed-bean>
              <managed-bean-name>MyNameBB</managed-bean-name>
              <managed-bean-class>com.minerva.trainees.MyNameBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>bioData</managed-bean-name>
              <managed-bean-class>com.minerva.trainees.BioDataBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>bioDataHome</managed-bean-name>
              <managed-bean-class>com.minerva.trainees.BioDataHomeBackingBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
              <managed-bean>
              <managed-bean-name>bioTest</managed-bean-name>
              <managed-bean-class>com.minerva.trainees.TestBean</managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
         </managed-bean>
              <managed-bean>
              <managed-bean-name>objBioDataVo</managed-bean-name>
              <managed-bean-class>com.minerva.trainees.BioDataVo</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>Please help me to solve this problem

    tracemein wrote:
    but, the action method "saveBean()" is not being called Maybe there was a validation or conversion error occurred. Add <h:messages /> to your page to take note of them and handle accordingly. Also read the application server logs if there isn't something interesting logged. JSF 1.2 by default logs undisplayed errors to the stdout.
    On the other hand, apart from the problem, you don't need h:panelGroup for single column items. Basically you can remove all of those h:panelGroup tags in your first h:panelGrid.

  • COBOL client unable to call Tuxedo methods (CSIMPAPP tutorial for Windows 2000 OS)

    Hi,
    This relates to another post below. I have compiled the COBOL client and the COBOL
    server and produced .exes however when I get runtime problems now
    I get the message: exec CSIMPSRV -A CMDTUX_CAT:819 INFO: Process id=1912 Assume
    started (pipe) but when I do tmadmin/psr, the process is (DEAD)
    Also when I run the client I get an error as soon as the client gets to a call
    to a Tuxedo method e.g. USERLOG or TPCALL, i get an error message
    Load error : file "USERLOG"
    error code 173 pc=0, call=1 seg=0
    173 called program not found in drive/directoryI have added %TUXDIR% to my path and everything.
    Any suggestions?
    Thanks
    Colm

    Winfried - Thanks for that, this might mean something
    These are the steps I take:
    Compile the CSIMPCL.cbl file using the COBOL.exe command ( Mcrofocus/NetExpress/bin)
    etc
    Then
    cblnames -v -mCSIMPCL CSIMPCL.obj
         buildclient -C -o CSIMPCL -f CSIMPCL.obj -f cbllds.obj
    ALl compiles ok - then when I run CSIMPCL.exe I get the error as detailed below
    already
    Load error : file "USERLOG"
    error code 173 pc=0, call=1 seg=0
    173 called program not found in drive/directory
    However I got mailed a copy of CSIMPCL.obj which had been built with Net Express
    4
    then
    cblnames -v -mCSIMPCL CSIMPCL.obj
         buildclient -C -o CSIMPCL -f CSIMPCL.obj -f cbllds.obj as before
    When I ran it ( without booting the server - just telling the client to send a
    message to the BBL and display a response) it ran fine
    so i think the COBOL.exe in Net Express 3 is not creating the obj file properly.
    I haven't hooked it up to WTC yet but it should work
    Any views you have are much appreciated. I'd be loth to blame a compiler if I
    hadn't some variable set but all the environmental variables seem to be in the
    path.
    "Winfried Scheulderman" <[email protected]> wrote:
    >
    Colm,
    Looks like a general problem running Cobol to me.
    The first message indicates something went wrong during server startup,
    see e.g.:
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=tux%2FS-03850.htm
    and
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=tux%2FS-16674.htm
    The cause for this is probably the same as for other error message.
    You should check the settings for running Cobol programs (clients and
    servers),
    especially the library path.
    Winfried
    "Colm O'Regan" <[email protected]> wrote:
    Hi,
    This relates to another post below. I have compiled the COBOL client
    and the COBOL
    server and produced .exes however when I get runtime problems now
    I get the message: exec CSIMPSRV -A CMDTUX_CAT:819 INFO: Process id=1912
    Assume
    started (pipe) but when I do tmadmin/psr, the process is (DEAD)
    Also when I run the client I get an error as soon as the client gets
    to a call
    to a Tuxedo method e.g. USERLOG or TPCALL, i get an error message
    Load error : file "USERLOG"
    error code 173 pc=0, call=1 seg=0
    173 called program not found in drive/directoryI have added %TUXDIR% to my path and everything.
    Any suggestions?
    Thanks
    Colm

  • ADF: is it possible to call bean methods from a DataForwardAction?

    Hi,
    i have created an ADF data control from bean and I have some values bound and populated in a page. As part of the Action class i would like to execute one of the methods in the bean. Is this possible or am i taking the wrong approach?
    regards,
    Brenden

    Yes, there are a few ways of doing it, please see...
    http://www.ps-scripts.com/bb/viewtopic.php?t=3109

  • Unable to call Forte method by SOAP

    Hi,
    I am trying to see about XML server forte example but I have a problem, After calling the forte method by SOAP, I have this message as result by iPlanet UDS:
    Exception in thread "main" java.lang.Exception: CustomerSOProxy.getName received
    SOAP Fault; code=SOAP-ENV:Client string=invalid request
    at com.forte.xmlsvr.customerservice.CustomerSOProxy.getName(CustomerSOPr
    oxy.java:43)
    at CustClient.main(CustClient.java:6)
    Customer is a Forte class used by CustomerSO service object in Forte. I have written getName method which returns my name. I did this for testing.
    I verified:
    - The application is running under environment console.
    - The client side call has correct URL http://localhost:9090
    I appreciate you help on this. Thank you very much in advance.

    by starting a new thread i will lose all change that
    i have done in the applet. new thread in the forums... what does that have to do either way with your applet? the forum is not tied to your code, neither would a Java thread, which you can always keep a copy of your original code. Or what are you talking about?
    the problem is that i have
    a applet in one window ...which can be modified (that
    is rotate etc). now i need to open another new window
    from this window . in this new window i want to
    display the modified applet . so tell me who can i
    capture the change in the appletI already answered your other thread that you did, finally, post.

  • How to execute a backing-bean method before loading JSP Page?

    Hi everybody.
    Scene:
    An AdfForm, with
    -SelectChoice, referenced to a <list> of pageDef, which is referenced to an ADF BC.
    Goal:
    -Executing the query of the ADF BC before load the SelectChoice, to load the correct values.
    A good question to know:
    Exists any way to execute a method of backing before loading a JSP Page?
    Any similar to onload method of javascript. It could be fantastic.
    Thanks in advance,
    Jaime

    hi Jaime
    If I understand correctly, you are using the ADF Model for data binding.
    Because your goal is "Executing the query of the ADF BC ...", maybe you can also consider to refresh an executable in your Page Definition.
    See also "10.5.5 How to Use Refresh Correctly for InvokeAction and Iterator Bindings"
    at http://download.oracle.com/docs/html/B25947_01/bcdcpal005.htm#BJECHBHF
    It says "... You can use the Refresh property on iterator bindings and invokeAction executables in your page definition to control when each are evaluated during the ADF page lifecycle, either during the prepareModel phase, the prepareRender phase, or both. ...".
    Although you have posted your question in a structured way, which is a good thing, I think it would help to understand your question if you can explain how you determine "the correct values" for your list, what is varying?
    success
    Jan Vervecken

  • How to call a method repeatedly with JSP custom tag?

    This senerio is very similar to the usage of StringBuffer.
    I have a problem which can be solved easily with scriptlets:
    <% NameValuePair nvp = new NameValuePair(request.getQueryString()); %>
    <a href="foo.html?<%=nvp.add(name1", "value1").add("name2", "value2").toString();%">">Foo</a>
    <a href="bar.html?<%=new NameValuePair(request.getQueryString()).add("x", 1).add("y", 2).toString()%>">Bar</a>
    But I cannot use scriplets because it's turned off. I can only use jsp custom tag / jstl. How would I implement this functionality with a custom tag? How would the JSP code look like? Our container supports JSP 2.0.
    Thanks.</a>

    hi,
    you can do within 2 step-
    1) use <%@page import="your_java_class"%>
    2)use scriptlet code <%...%> and write coding in this tag.
    means create instance of your java class .
    <% your_java_class obj1=new your_java_class();
         obj1.method_of_your_java_class();
    %>or
    3) you can make javabean to use method of java class.[Best option]
    Thanx
    Ranvijay

  • Unable to call exported client methods of EJB session bean remote interface

    I am unable to call client methods of a BC4J application module deployed as a Session EJB to Oracle 8i at the client side of my multi-tier application. There is no documentation, and I am unable to understand how I should do it.
    A business components project has been created. For instance, its application module is called BestdataModule. A few custom methods have been added to BestdataModuleImpl.java file, for instance:
    public void doNothingNoArgs() {
    public void doNothingOneArg(String astr) {
    public void setCertificate(String userName, String userPassword) {
    theCertificate = new Certificate(userName, userPassword);
    public String getPermission() {
    if (theCertificate != null)
    {if (theCertificate.getPermission())
    {return("Yes");
    else return("No, expired");
    else return("No, absent");
    theCertificate being a protected class variable and Certificate being a class, etc.
    The application module has been tested in the local mode, made remotable to be deployed as EJB session bean, methods to appear at the client side have been selected. The application module has been successfully deployed to Oracle 8.1.7 and tested in the remote mode. A custom library containing BestdataModuleEJBClient.jar and BestDataCommonEJB.jar has been created.
    Then I try to create a client basing on Example Oracle8i/EJB Client snippet:
    package bestclients;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import javax.naming.*;
    import oracle.aurora.jndi.sess_iiop.*;
    import oracle.jbo.*;
    import oracle.jbo.client.remote.ejb.*;
    import oracle.jbo.common.remote.*;
    import oracle.jbo.common.remote.ejb.*;
    import oracle.jdeveloper.html.*;
    import bestdata.client.ejb.*;
    import bestdata.common.ejb.*;
    import bestdata.common.*;
    import bestdata.client.ejb.BestdataModuleEJBClient;
    public class BestClients extends Object {
    static Hashtable env = new Hashtable(10);
    public static void main(String[] args) {
    String ejbUrl = "sess_iiop://localhost:2481:ORCL/test/TESTER/ejb/bestdata.BestdataModule";
    String username = "TESTER";
    String password = "TESTER";
    Hashtable environment = new Hashtable();
    environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    environment.put(Context.SECURITY_PRINCIPAL, username);
    environment.put(Context.SECURITY_CREDENTIALS, password);
    environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    BestdataModuleHome homeInterface = null;
    try {
    Context ic = new InitialContext(environment);
    homeInterface = (BestdataModuleHome)ic.lookup(ejbUrl);
    catch (ActivationException e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    System.exit(1);
    catch (CommunicationException e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    System.exit(1);
    catch (NamingException e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    System.exit(1);
    try {
    System.out.println("Creating a new EJB instance");
    RemoteBestdataModule remoteInterface = homeInterface.create();
    // Method calls go here!
    // e.g.
    // System.out.println(remoteInterface.foo());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    It doesnt cause any errors. However, how must I call methods? The public interface RemoteBestdataModule has no such methods:
    void doNothingNoArgs();
    void doNothingOneArg(java.lang.String astr);
    void setCertificate(java.lang.String userName, java.lang.String userPassword);
    java.lang.String getPermission();
    Instead of that it has the following methods:
    oracle.jbo.common.remote.PiggybackReturn doNothingNoArgs(byte[] _pb) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn doNothingOneArg(byte[] _pb, java.lang.String astr) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn customQueryExec(byte[] _pb, java.lang.String aQuery) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn setCertificate(byte[] _pb, java.lang.String userName, java.lang.String userPassword) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    oracle.jbo.common.remote.PiggybackReturn getPermission(byte[] _pb) throws oracle.jbo.common.remote.ejb.RemoteJboException, java.rmi.RemoteException;
    I cannot call those methods. I can see how they are called in BestdataModuleEJBClient.java file:
    public void doNothingNoArgs() throws oracle.jbo.JboException {
    try {
    oracle.jbo.common.remote.PiggybackReturn _pbRet = mRemoteAM.doNothingNoArgs(getPiggyback());
    processPiggyback(_pbRet.mPiggyback);
    if (_pbRet.isReturnStreamValid()) {
    return;
    catch (oracle.jbo.common.remote.ejb.RemoteJboException ex) {
    processRemoteJboException(ex);
    catch (java.rmi.RemoteException ex) {
    processRemoteJboException(ex);
    throw new oracle.jbo.JboException("Marshall error");
    However, I cannot call getPiggyback() function! It is a protected method, it is available to the class BestdataModuleEJBClient which extends EJBApplicationModuleImpl, but it is unavailable to my class BestClients which extends Object and is intended to extend oracle.jdeveloper.html.WebBeanImpl!
    It seems to me that I mustnt use RemoteBestdataModule interface directly. Instead of that I must use the public class BestdataModuleEJBClient that extends EJBApplicationModuleImpl and implements BestdataModule interface. It contains all methods required without additional arguments (see just above). However, how must I create an object of BestdataModuleEJBClient class? That is a puzzle. Besides my custom methods the class has only two methods:
    protected bestdata.common.ejb.RemoteBestdataModule mRemoteAM;
    /*This is the default constructor (do not remove)*/
    public BestdataModuleEJBClient(RemoteApplicationModule remoteAM) {
    super(remoteAM);
    mRemoteAM = (bestdata.common.ejb.RemoteBestdataModule)remoteAM;
    public bestdata.common.ejb.RemoteBestdataModule getRemoteBestdataModule() {
    return mRemoteAM;
    It looks like the remote application module must already exist! In despair I tried to put down something of the kind at the client side:
    RemoteBestdataModule remoteInterface = homeInterface.create();
    BestdataModuleEJBClient dm = new BestdataModuleEJBClient(remoteInterface);
    dm.doNothingNoArgs();
    Of course, it results in an error.
    System Output: null
    System Error: java.lang.NullPointerException
    System Error: oracle.jbo.common.PiggybackOutput oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyForRemovedObjects(oracle.jbo.common.PiggybackOutput) (ApplicationModuleImpl.java:3017)
    System Error: byte[] oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyfront(boolea
    System Error: n) (ApplicationModuleImpl.java:3059)
    System Error: byte[] oracle.jbo.client.remote.ApplicationModuleImpl.getPiggyback() (ApplicationModuleImpl.java:3195)
    System Error: void bestdata.client.ejb.BestdataModuleEJBClient.doNothingNoArgs() (BestdataModuleEJBClient.java:33)
    System Error: void bes
    System Error: tclients.BestClients.main(java.lang.String[]) (BestClients.java:76)
    I have studied a lot of documents in vain. I have found only various senseless discourses:
    "Use the Application Module Wizard to make the Application Module remotable and export the method. This will generate an interface for HrAppmodule (HrAppmodule.java in the Common package) which contains the signature for the exported method promoteAllEmps(). Then, deploy the Application Module. Once the Application Module has been deployed, you can use the promoteAllEmps() method in your client-side programs. Calls to the promoteAllEmps() method in client-side programs will result in calls to the promote() method in the application tier."
    However, I have failed to find a single line of code explaining how it should be called.
    Can anybody help me?
    Best regards,
    Svyatoslav Konovaltsev,
    [email protected]
    null

    Dear Steven,
    1. Thank you very much. It seems to me that the problem is solved.
    2. "I logged into Metalink but it wants me to put in both a tar number and a country name to see your issue." It was the United Kingdom, neither the US nor Russia if you mean my issue.
    I reproduce the text to be written by everyone who encounters the same problem:
    package bestclients;
    import java.util.Hashtable;
    import javax.naming.*;
    import oracle.jbo.*;
    public class BestdataHelper {
    public static ApplicationModule createEJB()
    throws ApplicationModuleCreateException {
    ApplicationModule applicationModule = null;
    try {
    Hashtable environment = new Hashtable(8);
    environment.put(Context.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
    environment.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_EJB);
    environment.put(Context.SECURITY_PRINCIPAL, "TESTER");
    environment.put(Context.SECURITY_CREDENTIALS, "TESTER");
    environment.put(JboContext.HOST_NAME, "localhost");
    environment.put(JboContext.CONNECTION_PORT, new Integer("2481"));
    environment.put(JboContext.ORACLE_SID, "ORCL");
    environment.put(JboContext.APPLICATION_PATH, "/test/TESTER/ejb");
    Context ic = new InitialContext(environment);
    ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup("bestdata.BestdataModule");
    applicationModule = home.create();
    applicationModule.getTransaction().connect("jdbc:oracle:kprb:@");
    applicationModule.setSyncMode(ApplicationModule.SYNC_IMMEDIATE);
    catch (NamingException namingException) {
    throw new ApplicationModuleCreateException(namingException);
    return applicationModule;
    package bestclients;
    import bestdata.common.*;
    import certificate.*;
    public class BestClients extends Object {
    public static void main(String[] args) {
    BestdataModule bestdataModule = (BestdataModule)BestdataHelper.createEJB();
    Certificate aCertificate = new Certificate("TESTER", "TESTER");
    //calling a custom method!!
    bestdataModule.passCertificate(aCertificate);
    Thank you very much,
    Best regards,
    Svyatoslav Konovaltsev.
    [email protected]
    null

  • How to get stateful and stateless session bean in second jsp

    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the second jsp? I find that somebody store the bean in HttpSession.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, both stateful and stateless can maintain the state in the second jsp. What is the difference between stateful and stateless session bean in this case ?
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use session bean. Can anyone provide sample jsp to show difference of stateful and stateless? How the stateful session bean can maintain the state for the client?

    Greetings,
    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the
    second jsp? I find that somebody store the bean in HttpSession.Which is the correct scope for sharing client-specific data when 'request' scope is insufficient.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is
    that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, bothWhy is that a "problem"? Does your application not require the stateless bean to be shared? If so, then don't store the EJBObject reference in the session...
    stateful and stateless can maintain the state in the second jsp. What is the difference betweenWhat do you mean by this exactly?..
    stateful and stateless session bean in this case ?Statefulness of session beans is in regard to maintaining client state (er, in all cases). If your "stateless" bean is receiving information from the client (i.e. its caller) - either through a create method or a business method - and that information is available (retrievable from the bean) on subsequent method calls, then that bean is, in fact, stateful - regardless of how it is deployed.
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use
    session bean.The correct question, it here seems, is "when" to use which type... Use a "stateful" bean when information about (from) the client (i.e. the caller) must be maintained across method calls of the bean. Use a "stateless" bean for general business methods that do not depend on "prior knowledge" of the client (i.e. the caller).
    Can anyone provide sample jsp to show difference of stateful and stateless? How the statefulA "sample JSP" would yield nothing additional... The semantics of calling, using, and "persisting", bean references are always the same - regardless of type or class. However, the reason(s) for using one over the other depends entirely on the needs of your application.
    session bean can maintain the state for the client?I recommend that you spend more time learning about EJBs generally. In particular, it seems you require more fundamental understanding of their scope and lifecycle. Refer to sections 4, 6, and 7 of the EJB 2.0 Specification.
    Regards,
    Tony "Vee Schade" Cook

  • Calling a method with a html Submit button

    hi guys,
    is it possible to call a method from a JSP file using a HTML submit button. I know i can call another website easily doing it this way, is there a similar way available to call a method once the button is clicked?
    FYI
    The method is in a bean file named jdbc. The methods name is getUsername.
    Nice one.
    <form action = <%jdbc.getUsername()%> <input type="submit" value="Submit">

    Dear friend,
    you mentioned that u need to call a method when submit button is clicked. Is the method dynamically created. If not so, then you can include the method on the submit button html file itself.
    Regards,
    Rengaraj.R

  • Statefull bean Reference in a JSP

    Weblogic Server 4.5.1
              I have got the reference to a statefull session bean in a JSP, how can i use
              the same reference of session bean in another JSP file. How is this
              achieved.
              Here is an example of the problem
              In a JSP file i display all the information regarding the user using the
              statefull session bean, since this bean maintains the session of the user i
              want to call another method in another jsp using the same statefull sessio
              bean object, which i created in first Jsp. How is this possible
              Thanks in Advance
              Update me. Keep in touch.
              With Warm Regards
              Pavan Kumar
              BenchMark Softech Limited
              150 Luz Church Road
              Mylapore
              Chennai - 4, TN-INDIA
              PH-4987589,90,91,92,93,4971094
              http://www.benchmarkindia.com
              

    Put the EJB handle in HttpSession.
              Cheers - Wei
              Pavan <[email protected]> wrote in message
              news:[email protected]..
              > Weblogic Server 4.5.1
              > I have got the reference to a statefull session bean in a JSP, how can i
              use
              > the same reference of session bean in another JSP file. How is this
              > achieved.
              > Here is an example of the problem
              >
              > In a JSP file i display all the information regarding the user using the
              > statefull session bean, since this bean maintains the session of the user
              i
              > want to call another method in another jsp using the same statefull sessio
              > bean object, which i created in first Jsp. How is this possible
              >
              >
              > Thanks in Advance
              >
              > --
              > -----------------------------------------------------------------
              > Update me. Keep in touch.
              > With Warm Regards
              > Pavan Kumar
              >
              > BenchMark Softech Limited
              > 150 Luz Church Road
              > Mylapore
              > Chennai - 4, TN-INDIA
              > PH-4987589,90,91,92,93,4971094
              > http://www.benchmarkindia.com
              >
              >
              

  • How to call a method of an other view in the current view

    Hi Guys,
    I have 2 views in my Project: IPrivateValidateIncidentView and IPrivateRoadMapView.  Now, a button in the IPrivateRoadMapView must call a method in the IPrivateValidateIncidentView.  I cannot seem to figgure this out.  I know that I will probably need to arrange things centrally in my Component COntroller somehow.
    I have tried to see what methods I can Invoke on IPrivateValidateIncidentView from within the Controller to see if I can call the method OnActionDoneValidate() from there, but I can only seem to get a constant with this methods name: IPrivateValidateIncidentView.WD_EVENTHANDLER_ON_ACTION_DONE_VALIDATION;
    Please help.
    Christiaan

    Hi,
    You are correct, for your requirement you need to arrange the things centrally that is in Component Controller. As in above reply you need to Create your context in Component controller and then map them to both the views. So data will be available to both the views and finally you create a method in component controller and call that method from second view. So the data changes made in controller will be reflected on First View as they have context mapping.
    Regards
    Raghu

  • Problem calling a method which takes a parameter from a table

    Hi guys,
    I'm very new to jsf and hope you can help me out.
    On my page i'm generating a list, which is working fine. now i want to add some commandLinks to the list entries. on click, i want to execute a bean method, which takes a parameter from the list, generates a picture and displays it on my page.
    here's a piece of code thats already working:
    <rich:dataTable var="data" value="#{pathwayBean.orgList}">
    <rich:columnGroup>     
            <rich:column>     
               <h:outputText value="#{data.name}" />
         </rich:column>
    </rich:columnGroup>
    </rich:dataTable>now, i want to replace the outputText with a commandLink, and execute a method with {data.id} as parameter. Unfortunately, the commandLink property "action" can only call bean methods with no parameter, or is that wrong?
    Thanks in advance,
    Alex

    use actionlistener.
    here a typical code that works fine for me:
    (JSF 1.2)
    //Java
    private Integer selectedItemId=null;
         public void selectItem(ActionEvent event) {
              // Find the UIParameter component by expression
              UIParameter component = (UIParameter) event.getComponent().findComponent("itemId");
              // parse the value of the UIParameter component
              try {
                   selectedItemId = Integer.parseInt(component.getValue().toString());
                   // find itemBean here using selectedItemId
              } catch (Exception e) {
                   logger.error(e, e);
              logger.info(" +++ selectedItemId =" + selectedItemId);
         public String viewItem() {
                 //create view beans here
                 return "itemView";//return appropriate view.
    //JSF
    <h:column>
                             <h:commandLink     id="View"
                                                 action="#{itemListBean.viewItem}"
                                                       actionListener="#{itemListBean.selectItem}">
                                  <h:outputText value="select"/>
                                  <f:param id="itemId" name="itemId" value="#{itemBean.id}"/>
                             </h:commandLink>
                     </h:column>

Maybe you are looking for

  • Songs are on my iPod but no longer in iTunes

    Hello everyone, I just had some computer work done and had to re-install iTunes (the latest version). When I open it up it still shows all the song titles I had before and the correct number of songs. HOWEVER the majority of them won't play. When I t

  • How to use layers from photoshop in final cut?

    I am googling, but not coming up with much updated info. I would like to use layers from a Photoshop stills file within Final Cut. Any good tutorial videos out there?

  • Quick MySQL Indexing question

    Hi all, I know this is not strcitly a JDBC problem, but i was wodering if you have any ideas anyhow... I've implemented an Index on two of my columns in a table in my MySQL db. My question is, when i insert new rows into the database, is the index au

  • Unable to open any website due to The proxy server is refusing connections, why?

    Firefox is opened, but unable to open any website. The message says, "The proxy server is refusing connections" & "Firefox is configured to use a proxy server that is refusing connections". I installed the version 8.0.1 again. But there was the same

  • Pavilion g6 Laptop Windows 8 Error 0xc000000f

    Laptop product number C1Y93EA#ABU using windows 8 Clapton froze and had to be turned off. On restarting either the laptop would say that it had failed to start correctly and needed to restart upon which it would immediately switch off and start again