• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Not retrieving from the Java Bean

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic