Duc Nguyen wrote: > Hi all, > > I am having a weird problem with my jsp page when I try to do the following. > > 1 I have a form where user can input some information > > 2 When the form submit I handle the request by a servlet and store > the information into a bean. > > org.apache.jasper.JasperException: Cannot find any information on > property 'Type' in a bean of type 'Product.ProductBean' > > Here is my code for it > [...] > ProductBean MyProduct = new ProductBean(); > MyProduct.setType(Type); > [...] > <td><jsp:getProperty name="product" property="Type" /></td>
A property name corresponds to the name after "get/set" in the property accessor method, with first character as lowercase. So in this example, the name of the property corresponding to the setType() method is "type", not "Type". Just change the first character to lowercase and it should work fine (assuming you also have a getter method in the bean): <jsp:getProperty name="product" property="type" /> > [...] > It cannot find any information for any of my get Property method. > > I want to get it to work with tomcat and I am using version 4.0.3. > > What weird is that I am able to get it to work with Jrun without any > problem it just tomcat giving me a hard time. If you know anything that > I might of done wrong please let me know. If it works with "Type" in JRun, it's a bug in JRun. These things are defined by the JavaBeans specification, and it's very clear on the naming conventions (i.e. always a lowercase first letter in the property name). Hans -- Hans Bergsten [EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com JavaServer Pages http://TheJSPBook.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com