• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

jsp to antoher jsp without submitting it

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to get it through session
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
 
reply
    Bookmark Topic Watch Topic
  • New Topic