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 / General / February 2006

Tip: Looking for answers? Try searching our database.

sending info from one jsp page to another...

Thread view: 
graniteraju@gmail.com - 23 Feb 2006 13:47 GMT
i have 2 html pages as below:

page1.html:

<html><head>
<title>page1</title>
</head>
<body>
<table>
<tr><td>
Do you have cars?
<input type="radio" name="havecars" value="yes">yes
<input type="radio" name="havecars" value="no">no
</td></tr>
<tr>
<td>No:of cars
<select name="cars">
<option>1</option>
<option>2</option>
<option>3</option>
</select></td></tr>
<tr><td>
<input type="button" value="next">
</td></tr>
</table>
</body></html>

page2.html

<html><head><title>page 2</title></head>
<table><tr><td>
have cars?
<input type="radio" name="havecars" value="yes">yes
<input type="radio" name="havecars" value="no">no
</td></tr>
<tr><td>
no:of cars
<input type="text">
</td></tr>
</table>
</html>

when I enter the values for the fields in page1 and click next I should

go to page2, which should already have its fields populated depending
on the values in page1...
Using JSP and servlets how do I do that?

thanks,
John O'Conner - 23 Feb 2006 16:14 GMT
> when I enter the values for the fields in page1 and click next I should
>
[quoted text clipped - 3 lines]
>
> thanks,

page1's "next" button should submit its contents (use a form) to a
servlet. That servlet will process the page1 form data and will then
forward to a page2.jsp. page2.jsp will populate the fields as you
require, and generate the page2.html that you need.

Use Google to search on things like "html+form", "html submit",
etc...that will get you started:
1. submit the form data
2. process it at the server
3. send it back via a jsp page

Solve each step in order.

Regards,
John O'Conner
Hal Rosser - 24 Feb 2006 03:47 GMT
> i have 2 html pages as below:
>
[quoted text clipped - 43 lines]
> on the values in page1...
> Using JSP and servlets how do I do that?

You have input tags - but they are not inside a form tag.
The form tag determines where to send the data when the user clicks the
submit button.
Take a look at  http://www.w3schools.com
where you'll see some html tutorials to get you up to speed on the html code
for submitting data to a jsp (or asp, or cgi, or php ...) page.


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



©2009 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.