Andrew:

        The beans spec says that property 'something' will be addressed through a
getter method 'getSomething()' (note capitalization of 's').  So your getter
method 'getMsg()' is referring to a property 'msg', not 'Msg'.  Yes, when
you capitalize 'Msg' you'll get 'Msg', but when Jasper does the
introspection on your bean, it interprets the methods to get 'msg', hence
"Cannot find any information on property 'Msg'..."

        Change to <jsp:getProperty name='dbean' property='msg'/> and you should be
fine.

Best of luck,

Greg Trasuk, President
StratusCom Manufacturing Systems Inc. - We use information technology to
solve business problems on your plant floor.
http://stratuscom.ca

>-----Original Message-----
>From: Andrew Guts [mailto:[EMAIL PROTECTED]]
>Sent: December 13, 2002 10:21
>To: [EMAIL PROTECTED]
>Subject: jsp:getProperty problem
>
>
>Hello all
>
>Please help me with this:
>
>file src/fe/MyBean1.java:
>package fe;
>public class MyBean1 {
>   private String msg = "MyBean1: Initial message";
>   public String getMsg() { return msg ; }
>   public void setMsg(String m) { msg = m; }
>}
>
>file test.jsp:
><%@ page language="java" %>
><html>
><jsp:useBean id="dBean" class="fe.MyBean1" />
><jsp:getProperty name="dBean" property="Msg" />
></html>
>
>Result:
>org.apache.jasper.JasperException: Cannot find any information
>on property 'Msg' in a bean of type 'fe.MyBean1'
>
>This variant works:
>
><%@ page language="java" %>
><html>
><jsp:useBean id="dBean" class="fe.MyBean1" />
><%=dBean.getMsg()%>
></html>
>
>j2sdk1.4.0-beta3, Tomcat 4.1.12, w2k
>
>Thanks ahead
>
>Andrew
>
>
>--
>To unsubscribe, e-mail:
><mailto:tomcat-user->[EMAIL PROTECTED]>
>For
>additional commands,
>e-mail: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to