Stefan Magin wrote:
>
> Hello,
> I’ve a problem with Tomcat 3.1 and JSP Beans.
>
> The following code doesn’t work in Tomcat 3.1 but works in Suns JSP
> severs 1.0
>
> Code :
> ****************************************************
> <html>
> <jsp:useBean id="DLoginData" scope="session" class="Login.DLoginData"
> type="Login.DLoginData" />
> <body>
> Hello <jsp:getProperty name="DLoginData" property="UserName"/>
> </body>
> </html>
> ****************************************************
>
> Tomcat bring this error message :
> Included servlet error: 500
> Location: /SMD/servlet/SMDMain
> Internal Servlet Error:
> org.apache.jasper.JasperException: Cannot find any information on property
> 'UserName' in a bean of type 'Login.DLoginData'
> [...]

That's because you're not following the naming conventions for bean properties.
If the bean has a method named getUserName(), the corresponding property is
named userName (note the lower case "u"), see the JavaBeans spec for details.

So try this instead:

  Hello <jsp:getProperty name="DLoginData" property="userName"/>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to