wood burning stoves 2.0*
The moose likes Struts and the fly likes can i get the form bean from the session? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "can i get the form bean from the session?" Watch "can i get the form bean from the session?" New topic
Author

can i get the form bean from the session?

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Hi all:
I just have a short question:

Say in my struts-config.xml file,
i give one of the form beans to session scope like the following


as you can see , the detalisForm is in the session scope, so let us say in my JSP page, I would like to refer to the detailForm, can i do the following?

I don't know what exactly I should put in the getAttribute() as parameter,

so if you know the answer, do not hesitate to let me know

Many ..Many Thanks
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

request.getSession().getAttribute("detailForm");

The "detailForm" is close.
In your mapping you referred to it as detailsForm, so that is the correct string to pass.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i get the form bean from the session?
 
Similar Threads
Where to create Collections for html:options
Html:link forward +parameter passing
Struts JSP/ActionForm error
Question about ActionForm in Struts
Problems with Indexed Properties - Repost