• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp to antoher jsp without submitting it  RSS feed

 
sam dims
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to get value from one jsp to antoher jsp without submitting it...
example:

first.jsp

<% String name=SAM;
%>


second.jsp
--->in this page i want to get the name...
with submitting with form action(request.getParameter()), i can get it but the
first.jsp is different page wich is submitting information to another page how can
I able to get it.


 
Sujai Kaarthik
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to get it through session
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need that? May be we could help you for a better design.
 
sam dims
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sujai Kaarthik wrote:try to get it through session



can you give any example
 
sam dims
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adeel Ansari wrote:Why do you need that? May be we could help you for a better design.


actually i have saved all names in that jsp, and that jsp is submitting to another jsp, but i want some names in this page
and i dont want to write code again therefore

Hope you have understood
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sam dims wrote:Hope you have understood


Not Really !
 
Sujai Kaarthik
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your first.jsp:

String var_1="value to be passed to second page"

session.setAttribute("obj",var_1);

In your second.jsp:

String var_2=(String)session.getAttribute("obj");
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!