Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / July 2004

Tip: Looking for answers? Try searching our database.

Storing data with one JSP and retrieving it with another

Thread view: 
Amy Johnson - 25 Jun 2004 19:43 GMT
Does anybody have any advice on how to store form data in a bean when
the user clicks the submit button, then retrieve the data and display it
in an already open jsp?

Thanks

Amy
Paul Davis - 26 Jun 2004 06:46 GMT
I'll recommend three ways.
The first is to use the struts framework and let this be handled for you.

The second is to use a servlet to handle the form submission. The servlet
can store the bean as a request attribute, and dispatch to the jsp. The jsp
can then retrieve the bean using the <jsp:useBean...> tag. It can retrieve
with scriptlets as well but, thats bad form.

If you just want something quick and dirty have the post submit to a jsp
page. The jsp page can use a jsp:useBean tag and a jsp:setProperty tag to
populate the bean.
see this here: http://www.jsptut.com/Forms.jsp
To counter that tutorial page, I'll recommend that you use JSTL tags instead
of the scriptlets for the output.

> Does anybody have any advice on how to store form data in a bean when
> the user clicks the submit button, then retrieve the data and display it
[quoted text clipped - 3 lines]
>
> Amy
Dirk Michaelsen - 28 Jun 2004 07:13 GMT
Hi Paul,

>I'll recommend three ways.

here is the fourth quick and dirty way:

Use sesssion.setAttribute(...) and session.getAttribute(...) to pass
data between two JSPs or servlets. It's the easiest way and you don't
need any bean.

cu
Dirk
Amy Johnson - 10 Jul 2004 00:49 GMT
Thanks for the help. I'll set it up and try it.

Amy

> I'll recommend three ways.
> The first is to use the struts framework and let this be handled for you.
[quoted text clipped - 18 lines]
>>
>>Amy


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.