This week's book giveaway is in the
We're giving away four copies of
and have Sam Newman on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Sending a bean to a struts jsp page
Joined: Sep 27, 2002
Nov 20, 2004 17:34:00
thanks for your help regarding previous post. I have one more question.
I have populated a bean and I wish to send it to a
page to be displayed.
How and where do I place the object. Do I put the bean in the response object of the action class then 'forward' the user to the jsp page so it can be displayed?
What is the best way to do this.
Note: I dont want to reuse the data so I cant see any point placing it in the session.
Joined: Aug 23, 2002
Nov 20, 2004 20:50:00
put your bean into the request object like so:
Object mybean = someobject;
Then, on the JSP you can access the bean like so:
efine id="thebean" name="mybean" scope="request" />
Make sure that you've included the
bean tld in the JSP. Look in the struts docs for more info about the bean tags.
It is sorta covered in the
JavaRanch Style Guide
subject: Sending a bean to a struts jsp page
Problem when the struts validator rejects user input
Beans in servlets?
JSP /Servlet - Printing issue
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015