• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Not retrieving from the Java Bean

 
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 ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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?
 
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.
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!