Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not retrieving from the Java Bean

 
Zoram Paul
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir,

I have this code

***********************************************************************


On another page I tried to retrieve the data 'dWord' which i set in the bean
The code I used in the second page was:

***********************************************************************

But the output it shows was:

The URL:

which seems its not retrieving anything,

Please help
Thank you

[BPSouther: Added code tags]
[ July 26, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the that first block of code?
Is it in a bean, a servlet, a scriptlet on another page?
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you are using Struts and setting a property in an Action Form

The action for is not automatically in pageScope
-----------------------------------------------------
<jsp:useBean id="urlBean" scope="page" class="examples.simple.GenerateUrlBean" />
<jsp:setProperty name="urlBean" property="url" />

-----------------------------------------------------

The useBean, because the GenerateUrlBean is not found in the pageScope creates one with a default constructor. When you try to set the url property, there is no property in the request called 'url' so it sets a blank String to the url property of the GenerateUrlBean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic