This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes passing an object from Action to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing an object from Action to jsp" Watch "passing an object from Action to jsp" New topic
Author

passing an object from Action to jsp

Madhu Sudhana
Ranch Hand

Joined: Apr 16, 2006
Posts: 127
Hi Ranchers,

How can we pass an object from Action class to view(jsp) .Using HttpSession we can do.Apart from this one how can we do??

Thanks in advance.


"And the trouble is, if you don't risk anything, you risk even more." -- Erica Jong.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
in Struts, the main mechanism for passing information between the JSP and the Action class is the ActionForm. You define properties on this JavaBean representing the information you want passed and you will generally put information into the ActionForm by calling one of it's setter methods. You can then retrieve the information using <bean:write> tags in your JSP. You can specify in the Action mapping you define in your struts-config.xml file whether you want the scope of the ActionForm to be session or request. The default is session.


Merrill
Consultant, Sima Solutions
 
jQuery in Action, 2nd edition
 
subject: passing an object from Action to jsp
 
Similar Threads
forwarding request to an action from a jsp page
handle many actions from one jsp page in struts
reset() funstion is not working
Can i use java class in action attribute in form tag of jsp page?
help with struts and a dynamic JSP