Pass parameter to a java bean

am new to jsp.
Nevertheless i have a table in a jspf with characters A-Z which are command links.
Here is the code
<%-- any content can be specified here e.g.: --%>
<body>
<table width="600" border="0">
    <TR>
       <%
        for(char i='A';i<='Z';i++)
            out.println("<TD><a href=\"x\">"+i+"</a></TD>");
         %>
    </TR>
</table>
</body>once i click on any of those letters, it should open a jsf href="x"
the backing bean should for the jsf should know the character i clicked
since i will use it in a query. the problem is how to ppass it from a command
link. for inputText, i have no problem.
assume i have this backing bean with the string searchStr to hold the value of the character i clicked, what should i add.
public class OfficerController1 {
    /** Creates a new instance of OfficerController */
    public OfficerController1() {
    private String searchStr;
    public DataModel getOfficers() {
        EntityManager em = getEntityManager();
        try{
            Query q = em.createQuery("select object(o) from Officer as o where o.fullName like '"+searchStr+"%'");
            q.setMaxResults(batchSize);
            q.setFirstResult(firstItem);
            model = new ListDataModel(q.getResultList());
            return model;
        } finally {
            em.close();
}

am glad this is my 100th post. means i have a passion for java. i envy guys
i see with 30000 post. seems they have been posting since their 10th birthday
<body>
<table width="600" border="0">
    <TR>
       <%
        for(char i='A';i<='Z';i++)
            out.println("<TD><h:commandLink  action=\"#{officer.searchOfficer2}\"value="+i+">"+
                         "<f:param name=\"firstLetter\" value=\""+i+" \"/>"+
                          "</h:commandLink></TD>");
                         %>
    </TR>
</table>
</body>this is transcation officer.searchOfficer2
public String searchOfficer2() {
        return "officer_search2";
    }from the faces config.xml
i have this
<navigation-rule>
    <navigation-case>
      <from-outcome>officer_search2</from-outcome>
      <to-view-id>/users/officer/officer/List2.jsp</to-view-id>
    </navigation-case>
  </navigation-rule>this new jsp has a backing bean which ought to get the parameter from
the command link.
i have this
public class OfficerController1 {
    /** Creates a new instance of OfficerController */
    public OfficerController1() {
private String firstLetter;
public String getFirstLetter() {
        return firstLetter;
    public void setFirstLetter(String firstLetter) {
        this.firstLetter = firstLetter;
public DataModel getOfficers2() {
        EntityManager em = getEntityManager();
        try{
            Query q = em.createQuery("select object(o) from Officer as o where o.fullName like '"+firstLetter+"%'");
            q.setMaxResults(batchSize);
            q.setFirstResult(firstItem);
            model = new ListDataModel(q.getResultList());
            return model;
        } finally {
            em.close();
    }}in the config.xml i added this
<managed-bean>
    <managed-bean-name>officer3</managed-bean-name>
    <managed-bean-class>users.entities.OfficerController1</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
       <property-name>firstLetter</property-name>
       <value>#{param.firstLetter}</value>>
    </managed-property>>
  </managed-bean>error message
Element 'managed-property' cannot have character [children], because the type's content type is element-only

Similar Messages

  • Passing javascript variable to java bean

    Hi all,
    Is there any way to pass a java script variable to a java bean. i'm trying hard but in vain. please suggest a way how to do it...

    The variable u want to pass declare that in a dataobject class i.e consisting of getter and setters ...... when you will use the jsp:useBean tab and the setProperty tag along with the class name it will set the value of the variables ...... use form method = get to set the variables.

  • Can we Return values from Java Bean to Form

    Hi All,
    I have a Bean area defined on a Form. The Bean Area consists of a Text field which gets populated by path of a file selected using Browse button.
    Can I return this path as a parameter from the Java Bean to the form? Is there any function for this?
    Regards,
    Prathima.

    If you designed your bean to offer the ability to exact info/data from it, then yes you can get a value from the bean into the form (pl/sql) - using Get_Custom_Property
    Refer to the following which is a good example of how to build a bean. Specifically look at page 12 where is shows how to use Get_Custom_Property.
    This is NOT an Oracle supported or provided document or web site, but it is a very good example.
    http://forms.pjc.bean.over-blog.com/ext/http://sheikyerbouti.developpez.com/forms-pjc-bean/first-bean/first_bean.pdf

  • Passing parameter from JS to Java Bean.

    We are using bing map to display outages data.
    Now requiement is
    in our JS we have
    var description;
    description=description + "<br><br>" + "Click " + "<a href='javascript:openPopUp()'>"+"*here*"+"</a>" + " to view full list of incidents";
    I am also getting cityname[i]
    so here i need to pass cityname on click of here to one of my java bean function.
    from where i am calling one method that takes city name as input and will return full list of incidents.

    here is how i was able to do .. In my javascript I am preparing param set and setting it to an event and raising this event.
    On my UI.. using a ServerListener.. I am binding this event to an bean method where I am able to access the param.
    here is the javascript:
    function myClientListener(event){
    var element = event.getSource();
    var param = {city:"new york", country:"US"};
    AdfCustomEvent.queue(element, "jsServerListener", param, true);
    event.cancel();
    jspx:
    <af:serverListener type="jsServerListener"
    method="#{MyBean.serverEventHandler}"/>
    bean method:
    public void serverEventHandler(ClientEvent clientEvent) {
    System.out.println(clientEvent.getParameters().get("city"));
    System.out.println(clientEvent.getParameters().get("country"));
    this may be helpful:
    http://naive-amseth.blogspot.com/2011/02/calling-methodbindingwebservice-on.html
    Amit

  • Need Help-How Store the input parameter through java bean

    Hello Sir,
    I have a simple Issue but It is not resolve by me i.e input parameter
    are not store in Ms-Access.
    I store the input parameter through Standard Action <jsp:useBean>.
    jsp:useBean call a property IssueData. this property exist in
    SimpleBean which create a connection from DB and insert the data.
    At run time servlet and server also show that loggging are saved in DB.
    But when I open the table in Access. Its empty.
    Ms-Access have two fields- User, Password both are text type.
    Please review these code:
    login.html:
    <html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="tmp" >
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>LoginServlet.java:
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String user=request.getParameter("user");
    String pass=request.getParameter("pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setUserName(user);
    st.setPassword(pass);
    request.setAttribute("user",st);
    request.setAttribute("pass",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean {
    private String user="";
    private String pass="";
    private String s="";
    public String getUserName() {
    return user;
    public void setUserName(String user) {
    this.user = user;
    public String getPassword() {
    return pass;
    public void setPassword(String pass) {
    this.pass = pass;
    public String getIssueData() //method that create connection with database
    try
    System.out.println("Printed*************************************************************");
    getUserName();
    getPassword();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:simple");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String User=getUserName();
    st.setString(1,User);
    String Password=getPassword();
    st.setString(2,Password);
    st.executeUpdate();
    System.out.println("Query Executed");
    con.close();
    s=  "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }submit.jsp:
    This is Submit page
    <html><body>
    Hello
    Student Name: <%= ((co.SimpleBean)request.getAttribute("user")).getUserName() %>
    <br>
    Password: <%= ((co.SimpleBean)request.getAttribute("pass")).getPassword() %>
    <br>
    <jsp:useBean id="st" class="co.SimpleBean" scope="request" />
    <jsp:getProperty name="st" property="IssueData" />
    </body></html>web.xml:<web-app>
    <servlet>
    <servlet-name>one</servlet-name>
    <servlet-class>LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>one</servlet-name>
    <url-pattern>/tmp</url-pattern>
    </servlet-mapping>
    <jsp-file>issue.jsp</jsp-file>
    <jsp-file>submit.jsp</jsp-file>
    <url-pattern>*.do</url-pattern>
    <welcome-file-list>
    <welcome-file>Login.html</welcome-file>
    </welcome-file-list>
    </web-app>Please Help me..Thanks.!!!
    --

    Dear Sir,
    Same issue is still persist. Input parameter are not store in database.
    After follow your suggestion when I run this program browser show that:i.e
    This is Submit page Hello Student Name: vijay
    Password: kumar
    <jsp:setProperty name="st" property="userName" value="userValue/> Your logging is saved in DB
    Please review my code.
    login.html:
    {code}<html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="tmp" >
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>{code}
    LoginServlet.java:
    {code}import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String userValue=request.getParameter("user");
    String passValue=request.getParameter("pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setuserName(userValue);
    st.setpassword(passValue);
    request.setAttribute("userValue",st);
    request.setAttribute("passValue",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }{code}
    SimpleBean.java:
    {code}package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean {
    private String userValue="";
    private String passValue="";
    private String s="";
    public String getuserName() {
    return userValue;
    public void setuserName(String userValue) {
    this.userValue = userValue;
    public String getpassword() {
    return passValue;
    public void setpassword(String passValue) {
    this.passValue= passValue ;
    public String getissueData() //method that create connection with database
    try
    System.out.println("Printed*************************************************************");
    getuserName();
    getpassword();
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("Connection loaded");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
    System.out.println("Connection created");
    PreparedStatement st=con.prepareStatement("insert into vij values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String userName=getuserName();
    st.setString(1,userName);
    String password=getpassword();
    st.setString(2,password);
    st.executeUpdate();
    System.out.println("Query Executed");
    con.close();
    s= "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }{code}
    submit.jsp:
    {code}This is Submit page
    <html><body>
    Hello
    Student Name: <%= ((co.SimpleBean)request.getAttribute("userValue")).getuserName() %>
    <br>
    Password: <%= ((co.SimpleBean)request.getAttribute("passValue")).getpassword() %>
    <br>
    <jsp:useBean id="st" class="co.SimpleBean" scope="request" />
    <jsp:setProperty name="st" property="userName" value="userValue/>
    <jsp:setProperty name="st" property="password" value="passValue"/>
    <jsp:getProperty name="st" property="issueData" />
    </body></html>web.xml:<web-app>
    <servlet>
    <servlet-name>one</servlet-name>
    <servlet-class>LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>one</servlet-name>
    <url-pattern>/tmp</url-pattern>
    </servlet-mapping>
    <jsp-file>submit.jsp</jsp-file>
    <url-pattern>*.do</url-pattern>
    <welcome-file-list>
    <welcome-file>Login.html</welcome-file>
    </welcome-file-list>
    </web-app>Sir I can't use EL code in jsp because I use weblogic 8.1 Application Server.This version are not supported to EL.
    Please help me...How store th input parameter in Database through Java Bean                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Request parameter are not stored in database through Java Bean

    Hi,
    I want to store the request parameter in database through Java Bean.Allthough program are properly run but value are not store in DB.
    Here My code:
    Login.html:<html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="submit.jsp" >
    Name: <input type="text" name="User">
    Password: <input type="password" name="Pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean implements java.io.Serializable{
    private String User="";
    private String Pass="";
    public SimpleBean(){}
    public String getUser() {
    return User;
    public void setUser(String User) {
    this.User = User;
    public String getPass() {
    return Pass;
    public void setPass(String Pass) {
    this.Pass = Pass;
    public void show()
         try
    System.out.println("Printed*************************************************************");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Loading....");
    Connection con=DriverManager.getConnection("jdbc:odbc:Ex11dump");
    System.out.println("Connected....");
    PreparedStatement st=con.prepareStatement("insert into Table1 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String User=getUser();
    st.setString(1,User);
    String Pass=getPass();
    st.setString(2,Pass);
    int y= st.executeUpdate();
    System.out.println(y);
    System.out.println("Query Executed");
    con.commit();
    con.close();
    System.out.println("Your logging is saved in DB *****************");
    catch(Exception e)
    e.printStackTrace();
    }submit.jsp:
    <jsp:useBean id="obj" class="co.SimpleBean"/>
    <jsp:setProperty name="obj" property="*" />
    <jsp:getProperty name="obj" property="User" /> <br>
    <jsp:getProperty name="obj" property="Pass" /> <br>
    <% obj.show();%>
    <%
    out.println("Ur data is saved in DB");
    %>Please Help me.
    Thanks.

    The issue is in the naming of your fields.
    Change User -> user and Pass->pass
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">

  • User parameter are not show in database using Servlet and java Bean

    Hello Sir,
    when I insert the parameter in run time, weblogic server and JSP show that parameter are saved.
    Allthough row increment in database but they not show in database.
    Here My Code:
    login.html:
    <html>
    <head>
    <title>A simple JSP application</title>
    <head>
    <body>
    <form method="get" action="tmp" >
    Name: <input type="text" name="user">
    Password: <input type="password" name="pass">
    <input type="Submit" value="Submit">
    </form>
    </body>
    </html>LoginServlet.java:import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException{
    try
    String user=request.getParameter("user");
    String pass=request.getParameter("pass");
    co.SimpleBean st = new co.SimpleBean();
    st.setuserName(user);
    st.setpassword(pass);
    request.setAttribute("user",st);
    request.setAttribute("pass",st);
    RequestDispatcher dispatcher1 =request.getRequestDispatcher("submit.jsp");
    dispatcher1.forward(request,response);
    catch(Exception e)
    e.printStackTrace();
    }SimpleBean.java:
    package co;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class SimpleBean {
    private String user="";
    private String pass="";
    private String s="";
    public String getuserName() {
    return user;
    public void setuserName(String user) {
    this.user = user;
    public String getpassword() {
    return pass;
    public void setpassword(String Pass) {
    this.pass= pass ;
    public String issueData()
    try
    System.out.println("Printed*************************************************************");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    System.out.println("Connection loaded");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@VijayKumar-PC:1521:XE","SYSTEM","SYSTEM");
    System.out.println("Connection created");
    PreparedStatement st=con.prepareStatement("insert into vij2 values(?,?)");
    System.out.println("~~~~~~~~~~~~~~~~~~~~");
    String NAME=getuserName();
    st.setString(1,NAME);
    String PASSWORD=getpassword();
    st.setString(2,PASSWORD);
      st.executeUpdate();
    System.out.println("Query Executed");
    con.close();
    s=  "Your logging is saved in DB ";
    System.out.println("Your logging is saved in DB *****************");
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    }submit.jsp:This is Submit page
    <jsp:useBean id="st" class="co.SimpleBean"/>
    <jsp:setProperty name="st" property="*" />
    <jsp:getProperty name="st" property="userName" /> <br>
    <jsp:getProperty name="st" property="password" /> <br>
    <% st.issueData();%>
    <%
    out.println("Ur data is saved in DB");
    %>Please Help me.
    Thanks.

    Ok, this seems to be a long and convoluted path to do absolutely nothing.
    You submit the form.
    You run a servlet that gets the parameters correctly (good), creates a SimpleBean (good) and then sets this into request attribute space under the names "user" and "pass" - (why?)
    You then forward to the jsp: submit.jsp.
    Submit.jsp creates a new SimpleBean, and attempts to populate it with <jsp:setProperty>. You then call the issueData method on it.
    Your complaint: Rows are being created in the database which have empty string values instead of the parameters you have passed.
    So, why are the values blank? Where do you think these values should be coming from?
    Looking at SimpleBean we find one mistake - you have mis-named your get/set methods.
    To properly follow java beans standards, you should use camel-case for your methods.
    Rather than getuserName() the method should be getUserName(). getpassword() should be getPassword() etc etc.
    The method getUserName() defines a property "userName" for the bean.
    Once that is fixed, lets go to submit.jsp. The <jsp:setProperty> statement will try and set all properties of the bean from the request parameters.
    There are no request parameters "userName" or "password" so those values don't get set in the bean, therefore it uses their default value of empty string - "".
    There ARE request parameters called "user" and "pass" but because they aren't properties of the bean, they get ignored.
    As a result, the values are empty string, and that is exactly what gets inserted into the database.
    Ways to fix this
    1 - rename your parameters on your form to be "userName" and "password" to match the bean. That way the <jsp:setProperty> tag will populate them properly.
    or
    2 - Call issueData() method from your servlet after you have created the SimpleBean. Better in my opinion as you then don't have any scriptlet code on a JSP page.
    Cheers,
    evnafets

  • Access Context Parameter in Java Bean.

    Hi,
    I want to access the Context parameter set by the web.xml from a java bean or simple java class. For example, If I have database connection details in my web.xml and I want to get these in a Java Bean of a class which will pick up the values and create a Connection object and return to the guy calling it, either JSP or servlet.
    I have a idea of using InitialContext class. But I doubt it works for
    Context parameter defined in the web.xml.
    It worked if I use like this for DataSource object which is created in my application server.
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("OMSDataSource");
    return ds.DatabaseConnection.getConnection();
    So how can I access a parameter like this..
    <context-param>
    <param-name>Webmaster</param-name>
    <param-value>[email protected]</param-value>
    </context-param>
    Cheers.
    L G Goundalkar

    Greetings,
    Hi,
    I want to access the Context parameter set by the web.xml from a java bean or simple java class.The bean doesn't have direct access to the context object so that access must to supplied to it - i.e by calling getServletContext() and passing the resulting reference to the bean.
    For example, If I have database connection details in my web.xml and I want to get these in a Java
    Bean of a class which will pick up the values and create a Connection object and return to the guy
    calling it, either JSP or servlet.Why not write a DAO to handle the JSP or servlet's access needs? The DAO can be initialized at application start with a context listener and the initialized instance placed in the context where the JSP or servlet can get it directly. ;)
    I have a idea of using InitialContext class. But I doubt it works for Context parameter defined in the
    web.xml.Not for context parameters (a different "space" from the JNDI namespace ;). But, of course, it does work for "environment entries" which may also be placed in the web.xml DD (er, presuming your web container supports JNDI, of course).
    Cheers.
    L G GoundalkarRegards,
    Tony "Vee Schade" Cook

  • How to pass parameter onclick of a command link created in a managed bean

    Hi,
    I created a command link in a managed bean using RichCommandLink . I want to pass a parameter on click of the command link like we do using <f:attribute> on the jspx. As i have created a command link using the bean hence i want to pass it programmatically to another method . How should i pass the parameter via the command link. Please help..

    Hi,
    can you please elaborate more on this.
    i am not getting what you are trying to tell.
    following is my actual code in java bean : :
    RichCommandLink remove= new RichCommandLink();
    remove.setId("E"+(rowID-1));
    remove.setText("Remove");
    FacesContext context = FacesContext.getCurrentInstance();
    MethodExpression actionListener = context.getApplication().getExpressionFactory().createMethodExpression(context.getELContext(), "#{viewScope.test.onRemove}", null, new Class[] {ActionEvent.class});
    remove.addActionListener(new MethodExpressionActionListener(actionListener));
    childrenOfGroupLayout.add(remove);
    Here i have created RichCommandLink in Bean, in this i want to add the <f:attribute>
    how to add this in my current component.
    can you give some example..
    please help..

  • How to pass a internal table into Java Bean

    Hi Experts,
    I created a JSPDyn page to display Sales orders form R/3 using bapi_sales_order_getlist.
    I used JCO to establish connectivity between JSP Dynpage and R/3. I executed the bapi successfully, i want to move the sales orders retrieved from the Bapi to a Java Bean. So that i can use the bean to populate the value as a table.
    with regards,
    James.
    Valuable answers will be rewarded.....

    Hi Bala,
    If you want to pass this internal table between different methods of the same view then write the contents of this internal table to a context node of your view using BIND_TABLE. You can then read the contents of this internal table from the other method using the reference of that node & the GET_STATIC_ATTRIBUTES_TABLE method.
    However if you want to pass the internal table between methods of different views then create a context node at the COMPONENTCONTROLLER level & then do a context mapping of this node to your local views context in both your views. You can follow the same BIND_TABLE & GET_STATIC_ATTRIBUTES_TABLE methods approach.
    Regards,
    Uday

  • How to pass a populated Java bean to a jsp

    Hi,
    I'm new to J2EE world. I want to know how should I pass a populated Java Bean (not EJB) to a JSP without displaying that JSP in the next step. I would be much grateful to anyone who gives a solution to my problem.
    Thanks in advance
    With best regards
    Sampath

    > I'm new to J2EE world. I want to know how should I
    pass a populated Java Bean (not EJB) to a JSP without
    displaying that JSP in the next step.
    Urk?
    A JSP is meant to be displayed. If there's business logic in that JSP, get it out of there. Process the bean as needed on the server side and send the flow on to some view that actually should be displayed.
    ~

  • How to pass parameter to the method in EJB session bean from Managed Bean

    Hi,
    I need some guidance in accessing the EJB session bean methods from one of my backing Bean. I use EJB 3.0 Entity Beans and EJB Session Beans. I have to get value from my page and pass it thro the backing bean to the respective EJB session bean. I have no clue of how to do this,
    When i click a command link on the page, in its backing bean click method, i am able to get a value and store in a variable under its click action. But from there i am not knowing of how to pass it as a variable to the EJB session bean and hence execute the query(this is where we have to pass the variable as a parameter in its where clause) in the entity bean.
    I wanna know how to make a call to the EJB session bean and from there execute the Enitity bean.
    Guide me regarding this....
    Thanks
    ri

    Unfortunately dependency injection doesn't work for jsf backing beans, so you have to use a normal jndi lookup to find your session bean. The following example shows you how to find a session bean and call a method:
    public void commandButton_actionListener(ActionEvent actionEvent) {
    Context ctx;
    try {
    ctx = new InitialContext();
    helloWorldEjb = (HelloWorldEJB)ctx.lookup("HelloWorldEJB");
    hello = helloWorldEjb.sayHello(name);
    System.out.println(hello);
    } catch (NamingException e) {
    e.printStackTrace();
    }

  • How to call the method from the java bean and pass it to JSP textbox

    i'm quite new to java thats why i'm asking how to call a method in the java bean file and pass it to the JSP textbox. My projects are communicating JSP with C#. i had successfully created a C# client bean file for JSP. The whole process is to type something on the server(C# programming) and it would appear in the textbox.

    your question doesn't provide much informartion. provide some other information and coding so that we could tell exactly what you are looking for?

  • Pass array of value to Oracle Java Beans (for forms)

    Hi,
    How I can pass a array value from oracle Form to Java bean.
    With regards
    Satheesh Kumar

    Hi,
    Thanks for your immediate response.
    I have one more doubt. I am trying to create a Hirachical tree for form using Jtree. For dynmically populating tree data I want to pass array records from oracle forms.
    In my understanding, Java importer array will work if we do importing the java beans component to oracle forms, otherwise no.
    Is it possible I can pass array variable with out importing my javacomponent.
    With regards

  • How to pass value from jsp to java bean

    I have huge problem . How to pass value from jsp value to java bean.Please replay me soon

    Use the <jsp:setProperty> tag. There are several ways to use it. The one you probably want is:
    <jsp:setProperty name="bean_name"  property="property_name"  value="the_value_you_want_to_set"/>

Maybe you are looking for

  • Mac mini and 5.1 surround

    Hi i'm changing my complete computer-parc from PC to mac. I will start with an imac 27" for my work and a mac-mini that will be attached to my HDTV and 5.1 sound-system. I have enough of windows and PC-stuff and want to switch as soon as possible. I'

  • Ant Task to restart an application in Weblogic Application Server?

    Hi, Is there any ant task available to stop, start, restart and application on weblogic application server 10.3? I use wldeploy for deploying the applications but sometimes, I need to just restart the application on the server.

  • I can use Ipad 3g in india

    Hi, I am thinking to buy a Ipad 3g with AT&T. Can I use this Ipad in India with Airtel or Vodafone network?

  • Nokia 6020 wont switch on

    i have the nokia 6020, the other day i found my phone swiched off when i tired to turn it on, the lights on the phone turns on for 2-3 seconds then its goes off. The phone is not turning on, this happens every time i press the power button last time

  • Newbie Simple AS 2 Problem

    Help! I have created a .flv-clip in After Effects (CS3) and I have a .FLA-File with animation and buttons. I need to show the .FLV-clip and then continue seamlessly with the .FLA-File. The .FLV-Clip is in Frame one and the .FLA-Animation starts in fr