• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

How can we send data from one jsp page to another jsp page

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
friends good day for you
i have a small question i want to send the data from one jsp to another jsp so please send me the example for this
thanks
vinay


--------------
vinay
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think it should like sending data to another form in html.
submit on your form.
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vinay,

You can use html tags like:
-----------------------------------------------------------
<form method="post" action="nextpage.jsp" name="inputpage">
<input type=text name="sample">
<INPUT TYPE="submit" Value="Submit" NAME="submit" title="Click to submit">
-----------------------------------------------------------
above in your first jsp page.
As soon as you click submit button, control as well as data-entered by the user in the textbox will go to next page as you mentioned in <form> tag.

To catch the values received from previous page, you can use JSP code in your second jsp page like:
-----------------------------------------
<%
String data=request.getParameter("sample");
out.println(data);
%>
-----------------------------------------
Here, the data stored in a textbox by name sample will be copied to string "data".
If you want to see whether the page received correct data or not,
you can use out.println statement.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To send the data from one JSP to other you use URL Rewriting or Hidden elements defination or cookies or Sessions these all are the Session Management techniques.
if you want it in details let me know I will s in more detail
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic