Java Bean Property Inspector

I have two questions to the property inspector:
First, is it possible to group the properties of a bean and how can I do this?
Can I define the order of the properties myself or are they always in alphabetical order?
Thank you for answering my questions!
Walter

Hi,
First question: It depends. The grouping of the properties are not determined by the JavaBean, but rather by JDeveloper integration code.
So, as a JavaBean writer, no, you cannot control the groupings. However, if you are writing integration code for JDeveloper (as of 9.0.4 which has not yet shipped) you do have control over the groupings, but those groupings will apply to all JavaBeans, not just your own, so any implementation would have to recognize objects of their own type and defer to a super implementation for all others.
By default the groupings seen are based on the JDeveloper 'out of the box' integration code. These groupings have been enhanced for 9.0.5 to include: General, Visual, Model and Focus. Still more meaningful groupings will be forthcoming.
Second question: same answer :-) JavaBean writers have no control. JDeveloper integration code is necessary and would affect all JavaBeans

Similar Messages

  • Possible to access bean property without Java Bean conventions?

    Hello,
    I'd like to show a component whenever there is an error message in the Faces context. Naively, I set the component's "rendered" attribute to the following:
    rendered="#{facesContext.messages.hasNext}"
    The object returned by facesContext.messages is an iterator, the properties of which do not follow Java Bean naming conventions. If there was a method called getHasNext() then all would be well. However as it stands, EL cannot evaluate this expression.
    I realise that wrapping this up in a managed bean would solve the problem, but I'd like to avoid this if I am able to do this directly from EL.
    Cheers,
    Chris

    Hi Juergen,
    hasNext actually returns a boolean which EL understands fine. In the end I just wrapped the call within a managed bean, as you suggested, and this works a treat:
      public boolean getHasMessages() {
        // hasNext will return true if there are any messages to be displayed
        return FacesContext.getCurrentInstance().getMessages().hasNext();
      }I suppose I felt compelled to post this entry since I found myself having to write some code for an expression that could be written perfectly well in EL but was limited only by the fact that EL can only access properties that follow the Java Bean convention.
    I thought that may have been some qualifier or method wrapper I could have used to mean 'take this property name literally'. Alas, it seems no such faclility exists.
    Thanks for taking the time to reply,
    Chris.

  • Best way to automatically map Java bean hierarchy to JavaFx property bean hierarchy

    We do not want JavaFx on the server side, so our DTO objects are plain Java beans.
    On the client side, we want to use the comfort of JavaFx bindings. As we're using Java 7, POJO bindings aren't possible yet.
    So we're looking for a way to automatically wrap the Java beans in JavaFx property beans.
    Possible approaches I've been looking into:
    - Code generation via JCodeModel
    - JavaBeanPropertyBuilder
    Ideally, we would want to have classes with structured JavaFx properties as a result, so that an ObjectProperty does not use the bean class, but always the respective JavaFx property bean class.
    This is so we don't need too many low-level bindings, but can rely on deep select bindings.
    This goes beyond the capabilities of JavaBeanPropertyBuilder as far as I understood it, so I'm left with fairly complex code generation using JCodeModel.
    Does anyone have some experience to share? Am I missing an option?

    Andipa wrote:
    As we're using Java 7, POJO bindings aren't possible yet.
    I'm sorry to reply without a good suggestion, but is there some type of POJO binding support in Java 8?
    This is what I currently use for POJO binding, but it doesn't sound very close to what you're asking for.  A lot of code still needs to be written by hand.  Also, I've only used it with relatively flat models so far.

  • Duplicate model property at extended  java bean

    Hello all!
    I am using a java bean model. It contains classes which sometimes extend other classes.
    After the import of java bean model, the model class has duplicate properties: one of the current class and one of the super class.
    for example:
    class Customer
    field name
    field moneySpent
    class GoodCustomer extends Customer
    field telephone
    even though I do not overwrite the fields name/moneySpent the model class has 5 model relations:
    name              --->relation name Customer.Name
    name              --->relation name GoodCustomer.Name
    moneySpent    --->relation name Customer.MoneySpent
    moneySpent    --->relation name GoodCustomer.MoneySpent
    telephone        --->relation name GoodCustomer.Telephone
    In the bind context view I can also see the five properties, so I am confused which one to really bind to the context...
    I would prefer the GoodCustomer relations, is that correct??
    Cheers
    stefan

    Hi Geert,
    I agree it is not very intuitive to have two model relations visible for the Inherited class.
    One workaround is, incase you only need one relation of the two visible. Go to the
    Model Editor of the Model Class by double clicking on the Model Class GoodCustomer. Go to the Relations tab and remove the relations
    name --->relation name GoodCustomer.Name and
    moneySpent --->relation name GoodCustomer.MoneySpent.
    The Relations tab shows the origin of both the relations in the Target Role column within brackets. This will help you identify the unwanted relation and delete it.
    However you can only delete relations from the sub class and not the super class.
    I hope this helps.
    Best Regards,
    Nidhi Rajshree

  • Property Inspector freezing jdeveloper

    I'm using Jdev 10.1.3.4.
    When I select a jsf component(command button) from the structure pane to load its properties into the Property Inspector pane, Jdev crashes.
    The cause seems to be my css imports, which I'm loading for my yui javascript components(http://developer.yahoo.com/yui/)
    Does anyone know why or how to make it stop?
    Here are my Includes, when I comment them out it works fine.
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/fonts/fonts-min.css" />
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/container/assets/skins/sam/container.css" />
    </head>
    <body class="yui-skin-sam">
    If anyone has an answer I would appreciate it, as it is quite annoying to have to comment and uncomment everytime I want to use the inspector.
    Thanks.

    sure
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="/webapp/careersTagLib" prefix="careersTagLib"%>
    <f:view>
      <html>
        <head>
          <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
          <title>Careers @ Davis School District - Apply</title>
                <link rel="stylesheet" type="text/css" href="css/defaultRed.css"/>
                <link rel="stylesheet" type="text/css" href="css/apply.css"/><%--
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/fonts/fonts-min.css" />
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/container/assets/skins/sam/container.css" />
    --%>
    <script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/utilities/utilities.js"></script>
    <script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/container/container-min.js"></script>
    <!-- Dependency -->
    <script src="http://yui.yahooapis.com/2.6.0/build/yahoo/yahoo-min.js" type="text/javascript"></script>
    <!-- Used for Custom Events and event listener bindings -->
    <script src="http://yui.yahooapis.com/2.6.0/build/event/event-min.js" type="text/javascript"></script>
    <!-- Source file -->
    <script src="http://yui.yahooapis.com/2.6.0/build/connection/connection-min.js" type="text/javascript"></script>
                <script type="text/javascript" src="js/apply.js"> </script>
        </head>
        <body class="yui-skin-sam"><careersTagLib:Nav/>
        <div class="contentBox">
            <div class="errMsgs">
              <h:messages showDetail="true" layout="list" rendered="#{backing_global.renderErrors}"/>
            </div>
             <h3>Employment Application</h3>
             <h:outputText value="appId from param: #{backing_apply.appParam}"/>
                     <h:form binding="#{backing_apply.formGeneralInfo}" id="formGeneralInfo">
                        <h:inputHidden binding="#{backing_apply.idFromApply}" id="idFromApply" value="#{backing_jobPostings.submitIdHidden.value}"/>
                        <h:inputHidden binding="#{backing_apply.applicationIdHidden}" id="applicationIdHidden"/>
              <div id="box">
                        <h4>General Information</h4>
                        <div class="innerBox"><div>You can save your application at any time and continue later by clicking save at the bottom of the page.<br />(<span class="required">*</span>) required</div>
                            <h:commandButton value="load from profile" binding="#{backing_apply.loadProfileBtn}" id="loadProfileBtn" immediate="true"
                                             action="#{backing_apply.loadProfileBtn_action}" actionListener="#{backing_apply.loadProfileBtn_actionListener}"/>
                            <div class="profileColumnLabel">
                            <h:commandButton value="commandButton1" binding="#{backing_apply.commandButton1}" id="commandButton1"/><careersTagLib:RequiredLabel >First Name:</careersTagLib:RequiredLabel>
                                <careersTagLib:RequiredLabel >Middle Name:</careersTagLib:RequiredLabel>
                                <careersTagLib:RequiredLabel >Last Name:</careersTagLib:RequiredLabel>
                                <h:outputLabel id="prefFirstNameLabel" value="Preferred First Name: " />
                                <h:outputLabel id="prefLastNameLabel" value="Preferred Last Name: " />
                                <h:outputLabel id="emailLabel" value="Email: " />
                                <h:outputLabel id="cellPhoneLabel" value="Cell Phone: #" />
                            </div>
                            <div class="profileColumn">                           
                                <h:inputText binding="#{backing_apply.firstName}" id="firstName"/>
                                <h:inputText binding="#{backing_apply.middleName}" id="middleName"/>
                                <h:inputText binding="#{backing_apply.lastName}" id="lastName"/>
                                <h:inputText binding="#{backing_apply.prefFirstName}" id="prefFirstName"/>
                                <h:inputText binding="#{backing_apply.prefLastName}" id="prefLastName"/>
                                <h:inputText binding="#{backing_apply.email}" id="email"/>
                                <h:inputText binding="#{backing_apply.cellPhone}" id="cellPhone"/>
                            </div>
                            <div class="profileColumnLabel">
                                <careersTagLib:RequiredLabel >Home Address:</careersTagLib:RequiredLabel>                           
                                <h:outputLabel id="homeAddress2Label" value="Address Line 2: " />
                                <careersTagLib:RequiredLabel >City:</careersTagLib:RequiredLabel>
                                <careersTagLib:RequiredLabel >State:</careersTagLib:RequiredLabel>
                                <careersTagLib:RequiredLabel >ZipCode:</careersTagLib:RequiredLabel>
                                <careersTagLib:RequiredLabel >Phone:</careersTagLib:RequiredLabel>    
                            </div>
                            <div class="profileColumn">
                                <h:inputText binding="#{backing_apply.homeAddress}" id="homeAddress"/>
                                <h:inputText binding="#{backing_apply.homeAddress2}" id="homeAddress2"/>
                                <h:inputText binding="#{backing_apply.homeCity}" id="homeCity"/>
                                <h:inputText binding="#{backing_apply.homeState}" id="homeState"/>
                                <h:inputText binding="#{backing_apply.homeZip}" id="homeZip" maxlength="5" size="8"/>
                                <h:inputText binding="#{backing_apply.homePhone}" id="homePhone"/>
                            </div>
                            <div class="profileColumnLabel">
                                <h:outputLabel id="altAddressLabel" value="Alternate Address: " />
                                <h:outputLabel id="altAddress2Label" value="Address Line 2: " />
                                <h:outputLabel id="altCityLabel" value="City: " />
                                <h:outputLabel id="altStateLabel" value="State: " />
                                <h:outputLabel id="altZipLabel" value="Zipcode: " />
                                <h:outputLabel id="altPhoneLabel" value="Phone #: " />                               
                            </div>
                            <div class="profileColumn">
                                <h:inputText binding="#{backing_apply.altAddress}" id="altAddress"/>
                                <h:inputText binding="#{backing_apply.altAddress2}" id="altAddress2"/>
                                <h:inputText binding="#{backing_apply.altCity}" id="altCity"/>
                                <h:inputText binding="#{backing_apply.altState}" id="altState"/>
                                <h:inputText binding="#{backing_apply.altZip}" id="altZip"/>
                                <h:inputText binding="#{backing_apply.altPhone}" id="altPhone"/>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <h:panelGrid columns="1" binding="#{backing_apply.qualificationsPanelGrid}" id="qualificationsPanelGrid"/>
                             <h4>Position Specific Information</h4>                   
                        <h4>Equal Opportunity Employer</h4>
                    </div>               
                    </h:form>
            </div>
            <div id="qualDialog" style="visibility:hidden;">
                    <div class="hd">Add/Edit Qualifications</div>
                    <div class="bd">            
                      <iframe id="addQualFrame" src="addQual.jsp"
                              width="100%" height="445"></iframe>
                    </div>
                  </div>
            <careersTagLib:Footer/>
        </body>
      </html>
    </f:view>
    <%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_apply--%> Thanks.

  • Java Bean Connectivity and Closing Connections (XI 3.0)

    Hi guys,
    We have existing Java Beans that we would like to use with Crystal Reports. Our current Java beans return a disconnected GridModel and explicitly close the connection immediately after so that they can be returned to the connection pool (Oracle).
    Once we modified these beans to return ResultSets we found that closing the connection also closes all the associated ResultSets and Statements.
    What is the best practice here?
    Modify the Java bean to close the connection in the finally block?
    Will Crystal clean up after itself?
    I also see there is something called a CachedRowSet which is disconnected:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/CachedRowSet.html
    Is this supported by Crystal?
    Thanks,
    Kevin D Lee =)

    Hello Kevin,
    Enterprise XI 3.0 CRConfig.xml points to Java JRE 1.5 provided with the install, so you should be ok with the CachedRowSet. 
    It's used by other customers for disconnected operation.
    Since you're going to Oracle, you'd likely encounter issues mapping Oracle fields to POJO property types.
    Furthermore, POJO Factory libraries that were shipped with Crystal Reports XI Release 2 aren't shipped with Enterprise XI 3.0, so you'd not find that an out-of-the-box option. 
    Another alternative to CachedRowSet is to define callback method in your JavaBeans class that Crystal will call when it's done with the data source. 
    This has been implemented in XI 3.0 (track ADAPT00877915) - excerpt from the track note:
    <JavaBeans>
        <CacheRowSetSize>100</CacheRowSetSize>
         <JavaBeansClassPath>c:\javabeans\</JavaBeansClassPath>
         <CallBackFunction>CrystalReportsLogoff</CallBackFunction>
    </JavaBeans>
          Customer can configuration the <CallBackFunction/> to let CR know
          which function should be invoked when loging off.
    Advantage of CachedRowSet is that you can immediately close it after you've read all the data, disadvantage would be the default implementation stores all data in memory.
    Advantage of the callback method is that it would use the JavaBean you've supplied (and not load all data immediately in memory), but callback won't be called immediately, but only after the report is done with.
    Sincerely,
    Ted Ueda

  • Problem with java beans and jsp on web logic 6.0 sp1

              HI ,
              I am using weblogic6.0 sp1.
              i have problem with jsp and java beans.
              i am using very simple java bean which stores name and email
              from a html form.
              but i am getting following errors:
              Full compiler error(s):
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              ^
              D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              cannot resolve symbol
              symbol : class userbn
              location: class jsp_servlet._savename2
              ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              "userbn"); //[ /SaveName2.jsp; Line: 7]
              ^
              3 errors
              in which directory should i place java bean source file(.java file)
              here is my jsp file:
              <%@ page language = "java" contentType = "text/html" %>
              <html>
              <head>
              <title>bean2</title>
              </head>
              <body>
              <jsp:usebean id = "ud" class = "userbn" >
              <jsp:setProperty name = "ud" property = "*" />
              </jsp:usebean>
              <ul>
              <li> name: <jsp:getProperty name = "ud" property = "name" />
              <li> email : <jsp:getProperty name = "ud" property = "email" />
              </ul>
              </body>
              <html>
              here is my bean :
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              import java.io.*;
              public class userbn implements Serializable
                   private String name ;
                   private String email;
                   public void setName(String n)
                        name = n;
                   public void setEmail(String e)
                        email = e;
                   public String getName()
                        return name;
                   public String getEmail()
                        return email;
                   public userbn(){}
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              pls help me.
              Thanks
              sravana.
              

              You realy can do it like Xiang says, but the better way is to use packages. That's
              the way BEA is designed for. If you use packages you can but your bean classes
              in every subfolder beneath Classes. Here for example we have the subfolders test
              and beans:
              You have to declare the package on top of your Bean Source Code:
              package test.beans;
              In your JSP you don't need the import code of Xiang. You only have to refer the
              path of your bean class:
              <jsp:useBean id="testBean" scope="session" class="test.beans.TestBean" />
              There are some other AppServers that only can deploy Java Beans in packages. So
              if you use packages you are always on the right side.
              ciao bernd
              "sravana" <[email protected]> wrote:
              >
              >Thank you very much Xiang Rao, It worked fine.
              >Thanks again
              >sravana.
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >><%@ page import="userbn" language = "java" contentType = "text/html"
              >>%> should
              >>work for you.
              >>
              >>
              >>"sravana" <[email protected]> wrote:
              >>>
              >>>HI ,
              >>>
              >>>I am using weblogic6.0 sp1.
              >>>
              >>>i have problem with jsp and java beans.
              >>>
              >>>i am using very simple java bean which stores name and email
              >>>
              >>>from a html form.
              >>>
              >>>but i am getting following errors:
              >>>
              >>>________________________________________________________________
              >>>
              >>>Full compiler error(s):
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:89:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> userbn ud = (userbn) //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>D:\bea4\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp_myserver\jsp_servlet\_savename2.java:94:
              >>>cannot resolve symbol
              >>>symbol : class userbn
              >>>location: class jsp_servlet._savename2
              >>> ud = (userbn) java.beans.Beans.instantiate(getClass().getClassLoader(),
              >>>"userbn"); //[ /SaveName2.jsp; Line: 7]
              >>> ^
              >>>3 errors
              >>>
              >>>____________________________________________________________
              >>>
              >>>in which directory should i place java bean source file(.java file)
              >>>
              >>>here is my jsp file:
              >>>--------------------------------------------------------
              >>>
              >>><%@ page language = "java" contentType = "text/html" %>
              >>><html>
              >>><head>
              >>><title>bean2</title>
              >>></head>
              >>><body>
              >>><jsp:usebean id = "ud" class = "userbn" >
              >>><jsp:setProperty name = "ud" property = "*" />
              >>></jsp:usebean>
              >>><ul>
              >>><li> name: <jsp:getProperty name = "ud" property = "name" />
              >>><li> email : <jsp:getProperty name = "ud" property = "email" />
              >>></ul>
              >>></body>
              >>><html>
              >>>
              >>>-------------------------------------------------------------
              >>>
              >>>here is my bean :
              >>>
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>import java.io.*;
              >>>
              >>>public class userbn implements Serializable
              >>>{
              >>>
              >>>     private String name ;
              >>>
              >>>     private String email;
              >>>
              >>>     public void setName(String n)
              >>>     {
              >>>
              >>>          name = n;
              >>>     }
              >>>
              >>>     public void setEmail(String e)
              >>>     {
              >>>
              >>>          email = e;
              >>>     }
              >>>
              >>>     public String getName()
              >>>     {
              >>>
              >>>          return name;
              >>>     }
              >>>
              >>>     public String getEmail()
              >>>     {
              >>>
              >>>          return email;
              >>>     }
              >>>
              >>>     public userbn(){}
              >>>}
              >>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              >>>
              >>>pls help me.
              >>>Thanks
              >>>sravana.
              >>>
              >>
              >
              

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • An error in jsp page useBean when i try to include the java bean package?

    Hi Sir,
    I am using import com.project.ShowData in java beans inorder to connect to the jsp.
    The jsp code goes like this:-
    <%@ page import="com.project.ShowData" %>
    <jsp:useBean id="jspuser1" class="com.viman.ShowData" scope="session"/>
    <jsp:setProperty name="jspuser1" property="*"/>
    Here the error is showing as cannot resolve symbols in com.project.ShowData.But i have given the same in java beans like this:-
    Package com.project;
    //import of package goes here
    public class ShowData
    //code goes here
    It seems that all are correct here.I have done few programs using this without any problem.But suddenly it is giving a problem like this.What is the problem here?It is quite Urgent.Thank u.
    Regards,
    m.ananthu

    Greetings,
    Here the error is showing as cannot resolve symbols in com.project.ShowData.But i have given the
    same in java beans like this:-Seeing the actual error would be more helpful. ;)
    Regards,
    m.ananthu Regards,
    Tony "Vee Schade" Cook

  • Portal runtime error: Cannot access bean property

    Dear all,
    Does anybody have a clue what problem might couse the <b>Portal Runtime Error</b> described below?
    It does seem to occur when a second user wants to access the <b>Component</b>.
    <b>Portal Runtime Error</b>
    An exception occurred while processing a request for :
    iView : pcd:portal_content/com.xxxxx.luminaires/com.xxxx.iviews/Quotations/EasyQuote
    <b>Component</b> Name : EasyQuoteDemo.EasyQuoteComponent
    Tag tableView attribute model: Cannot access bean property quotationHeader.CurrentTableModel in page context.
    Exception id: 04:50_21/09/04_0070
    See the details for the exception ID in the log file
    Thxs in advance
    Joost

    Hi Dominik,
    Having a closer look at the problem, we found it is not the number of users.
    It seems our JAVA components keeps the conenctions with SAP open and reopens a new one every time we start the component.
    If we finished solving the problem, I will publish the solution.
    Greetings,
    Joost

  • How to get an XML string from a Java Bean without wrting to a file first ?

    I know we can save a Java Bean to an XML file with XMLEncoder and then read it back with XMLDecoder.
    But how can I get an XML string of a Java Bean without writing to a file first ?
    For instance :
    My_Class A_Class = new My_Class("a",1,2,"Z", ...);
    String XML_String_Of_The_Class = an XML representation of A_Class ?
    Of course I can save it to a file with XMLEncoder, and read it in using XMLDecoder, then delete the file, I wonder if it is possible to skip all that and get the XML string directly ?
    Frank

    I think so too, but I am trying to send the object to a servlet as shown below, since I don't know how to send an object to a servlet, I can only turn it into a string and reconstruct it back to an object on the server side after receiving it :
    import java.io.*;
    import java.net.*;
    import java.util.*;
    class Servlet_Message        // Send a message to an HTTP servlet. The protocol is a GET or POST request with a URLEncoded string holding the arguments sent as name=value pairs.
      public static int GET=0;
      public static int POST=1;
      private URL servlet;
      // the URL of the servlet to send messages to
      public Servlet_Message(URL servlet) { this.servlet=servlet; }
      public String sendMessage(Properties args) throws IOException { return sendMessage(args,POST); }
      // Send the request. Return the input stream with the response if the request succeeds.
      // @param args the arguments to send to the servlet
      // @param method GET or POST
      // @exception IOException if error sending request
      // @return the response from the servlet to this message
      public String sendMessage(Properties args,int method) throws IOException
        String Input_Line;
        StringBuffer Result_Buf=new StringBuffer();
        // Set this up any way you want -- POST can be used for all calls, but request headers
        // cannot be set in JDK 1.0.2 so the query string still must be used to pass arguments.
        if (method==GET)
          URL url=new URL(servlet.toExternalForm()+"?"+toEncodedString(args));
          BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
          while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
        else     
          URLConnection conn=servlet.openConnection();
          conn.setDoInput(true);
          conn.setDoOutput(true);           
          conn.setUseCaches(false);
          // Work around a Netscape bug
          conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
          // POST the request data (html form encoded)
          DataOutputStream out=new DataOutputStream(conn.getOutputStream());
          if (args!=null && args.size()>0)
            out.writeBytes(toEncodedString(args));
    //        System.out.println("ServletMessage args: "+args);
    //        System.out.println("ServletMessage toEncString args: "+toEncodedString(args));     
          BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
          while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
          out.flush();
          out.close(); // ESSENTIAL for this to work!          
        return Result_Buf.toString();               // Read the POST response data   
      // Encode the arguments in the property set as a URL-encoded string. Multiple name=value pairs are separated by ampersands.
      // @return the URLEncoded string with name=value pairs
      public String toEncodedString(Properties args)
        StringBuffer sb=new StringBuffer();
        if (args!=null)
          String sep="";
          Enumeration names=args.propertyNames();
          while (names.hasMoreElements())
            String name=(String)names.nextElement();
            try { sb.append(sep+URLEncoder.encode(name,"UTF-8")+"="+URLEncoder.encode(args.getProperty(name),"UTF-8")); }
    //        try { sb.append(sep+URLEncoder.encode(name,"UTF-16")+"="+URLEncoder.encode(args.getProperty(name),"UTF-16")); }
            catch (UnsupportedEncodingException e) { System.out.println(e); }
            sep="&";
        return sb.toString();
    }As shown above the servlet need to encode a string.
    Now my question becomes :
    <1> Is it possible to send an object to a servlet, if so how ? And at the receiving end how to get it back to an object ?
    <2> If it can't be done, how can I be sure to encode the string in the right format to send it over to the servlet ?
    Frank

  • Can't set managed bean property:

    Hi,
    I am trying to experiment with JSF and I am extending an example I downloaded from the web. When I added a new secret field and extened the bean. I get the following error. I trying to resolve this problem from two days , cant figure out why I get this exception. I tried changed the property name I still get the same error. It is something to do with the bean, I am not sure why its not able to set the property, I know that the get and set methods exist in the class file. Any help would be greatly appreciated . I have pasted the bean file, faces-config.xml, and the inputname.jsp file below. Thanks a lot.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'word'.
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    javax.servlet.ServletException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'word'.
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:531)
         at org.apache.jsp.inputname_jsp._jspService(inputname_jsp.java:94)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
         at java.lang.Thread.run(Thread.java:536)
    My JSP file is
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:loadBundle basename="demo.bundle.Messages" var="Message"/>
    <HTML>
    <HEAD> <title>Input Name Page</title> </HEAD>
    <body bgcolor="white">
         <f:view>
              <h1><h:outputText value="#{Message.inputname_header}"/></h1>
              <h:messages style="color: red"/>
         <h:form id="helloForm" >
              <h:outputText value="#{Message.prompt}"/>
              <h:inputText id="userName" value="#{GetNameBean.userName}" required="true">
                   <f:validateLength minimum="2" maximum="10"/>
              </h:inputText>
              <h:inputSecret id="word" value="#{GetNameBean.word}" required="true">
                   <f:validateLength minimum="2" maximum="10"/>
              </h:inputSecret>
              <h:commandButton id="submit" action="sayhello" value="Say Hello" />
         </h:form>
    </f:view>
    </HTML>
    My faces-config.xml is as follow
    <?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>
    <navigation-rule>
    <from-view-id>/inputname.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/greeting.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <description>
    Input Value Holder
    </description>
    <managed-bean-name>GetNameBean</managed-bean-name>
    <managed-bean-class>demo.GetNameBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>userName</property-name>
    <property-class>java.lang.String</property-class>
    <value></value>
         </managed-property>
         <managed-property>
    <property-name>word</property-name>
         <property-class>java.lang.String</property-class>
         <value></value>
         </managed-property>
    </managed-bean>
    </faces-config>
    My bean file is as follows GetNameBean.java
    package demo;
    * @author Sergey Smirnov. Exadel, Inc.
    public class GetNameBean {
    private String userName;
    private String word;
    * @return User Name
    public String getUserName() {
    return userName;
    * @param User Name
    public void setUserName(String name) {
    this.userName = name;
    * @return Password
    public String getWord() {
    return word;
    * @param Password
    public void setWord(String word) {
    this.word = word;

    Hello,
    Thanks for the reply. I used Camelcase, but its giving me the same error. I am also posting my bean files and jsp files for your reference.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'UserName'.
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    javax.faces.FacesException: org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.FacesException: Can't set managed bean property: 'UserName'.
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:327)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
    LOGIN.JSP file
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <f:view>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <f:verbatim escape="false">
    <head>
    <title>My JSP 'login.jsp' starting page</title>
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <!--
         <link rel="stylesheet" type="text/css" href="styles.css">
         -->
    </head>
    </f:verbatim>
    <body>
    <h:form rendered="true" id="loginform">
    <f:verbatim escape="false"><br><br> </f:verbatim>
    <h:outputLabel for="userName" rendered="true"></h:outputLabel>
    <h:inputText id="userName" required="true" rendered="true" value="#{UserBean.userName}"></h:inputText>
    <f:verbatim escape="false"><br> </f:verbatim>
    <h:outputLabel for="password" rendered="true"></h:outputLabel>
    <h:inputSecret id="password" redisplay="false" required="true" rendered="true" value="#{UserBean.password}"></h:inputSecret>
    <h:commandButton id="submit" action="#{UserBean.loginUser}" rendered="true" value=" Submit"></h:commandButton><br><br></h:form>
    </body>
    </html>
    </f:view>
    UserBean file
    package com.jsfdemo.bean;
    import javax.faces.application.FacesMessage;
    import javax.faces.context.FacesContext;
    * @author ExterroAdmin
    public final class UserBean extends Object
         private String password;
         private String userName;
         public UserBean()
              super();
         public String getPassword()
              return password;
         public void setPassword(String password)
              this.password = password;
         public String getUserName()
              return userName;
         public void setUserName(String userName)
              this.userName = userName;
         public String loginUser() {
    if("myeclipse".equals(getUserName()) && "myeclipse".equals(getPassword()))
    return "success";
    FacesContext facesContext = FacesContext.getCurrentInstance();
    FacesMessage facesMessage = new FacesMessage(
    "You have entered an invalid user name and/or password");
    facesContext.addMessage("loginForm", facesMessage);
    return "failure";
    If you need any more information, please let me know

  • 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">

  • Webutil - java bean not found issue when openning the form another time

    Hello,
    I have a form which uses webutil and is called from another form (using CALL_FORM), the code runs from the when-window-activated trigger and it works well.
    But after the form closes (EXIT_FORM), and then called again (CALL_FORM(...,HIDE) it shows a message that the file java bean was not found....
    can someone help?

    Hello,
    Maybe this comes from the HIDE parameter. Actually, the bean area have to be shown (so its visible property must be true and the canvas must be displayed) to be taken into account.
    Francois

  • Problem in using java bean with jsp

    Hi,
    This is my code and i get this error. Not able to trace the mistake.
    bean.html
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Fname</title>
    </head>
    <body>
    <form method="POST" action="http://localhost:8080/beanjsp.jsp">
         <p>Fname: <input type="text" name="T1" size="20"></p>
         <p>Lname: <input type="text" name="T2" size="20"></p>
         <p> </p>
         <p> </p>
         <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    </body>
    </html>
    beanjsp.jsp
    <jsp:useBean id="bean" class="beans.FirstBean" scope="application" />
    <jsp:setProperty name="bean" property="fname" param="T1" />
    <jsp:setProperty name="bean" property="lname" param="T2" />
    THE FIRST NAME IS <%=bean.getFname() %>
    THE LAST NAME IS <%=bean.getLname() %>
    FirstBean.java
    //CREATING A BEAN
    package beans;
    import java.io.*;
    public class FirstBean
         private String fname;
         private String lname;
         FirstBean()
              fname="";
              lname="";
         public void setFname(String fn)
              fname=fn;
         public void setLname(String ln)
              lname=ln;
         public String getFname()
              return fname;
    public String getLname()
              return lname;
    error report
    org.apache.jasper.JasperException: /beanjsp.jsp(2,0) The value for the useBean class attribute beans.FirstBean is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)I have placed the beans package folder containing FirstBean.class inside classes folder of ROOT directory.
    I don't know what s wrong with my code :( ... Plz help asap.
    Thanks,
    Akshatha

    I have placed the beans package folder containing FirstBean.class >inside classes folder of ROOT directory.Place it in the WEB-INF/classes folder
    ram.

Maybe you are looking for