File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with jsp:useBean

 
Asuthosh Borikar
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am learning JSP, on Weblogic Server 5.1.0
One of my test JSPs contain the following code:
<jsp:useBean id="testBean" class="com.code.TestBean"/>
<jsp:setProperty name="testBean" property="name" value="ABCXYZ"/>
<jsp:setProperty name="testBean" property="count" value="200"/>
<BR>
<B>NAME</B> is : <jsp.getProperty name="testBean" property="name"/>
<BR>
<i>NAME</i> is : <%=testBean.getName()%>
<BR>
<B>COUNT</B> is : <jsp.getProperty name="testBean" property="count"/>
<BR>
<i>COUNT</B> is:<%=testBean.getCount()%>
Where TestBean is a regular Java Class, with private attributes int count, and String name, and public methods to set and get them.
The result of executing this JSP is:
NAME is :
NAME is : ABCXYZ
COUNT is :
COUNT is:200
It's obvious that Bean is being created and the properties are being set. But, when I use getProperty it's failing, although it works if I use a regular JSP Expression.
What am I missing here? Could some one please help me?
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Asuthosh Borikar:
What am I missing here? Could some one please help me?

Try <jsp:getProperty>. Note colon instead of dot. These things happen to the best of us
- Peter

 
Asuthosh Borikar
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did that and it works fine now. Thanks Peter.(For your answer to my question and for your motivation).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic