• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

taking value w/o submit

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
was wondering if there was any way that i could navigate from page1 to page2 via a link, but also keeping a text value without submit(maybe by setting it in request or session scope).

thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The fact that you mention request and session scope makes this not an HTML question, but a JSP one.

Moved to the JSP forum.
[ September 30, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, whenever you click a link you are submitting a request (a GET in this case).

To get a value from one request to the other you could:

1) pass it as a request parameter on the URL
2) store it in a cookie
3) tack it onto session scope (request scope will not do)
4) store it in a DB
5) store it in a file

and so on.

If the value is transient and only needs to be passed from the first page to the send without having to stay around, option (1) makes the most sense.
[ September 30, 2005: Message edited by: Bear Bibeault ]
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know I was not clear with my question should read the "how to ask a smart question" again.

Bear, I know i want to set it to the session scope. but i was having problems getting the actual value from the field.
<%
session.setAttribute( "atribName", how would I get the value here);
%>

How would i do that, actually that's why I thought I should I should post the Q in the javascript forum.
[ September 30, 2005: Message edited by: mannu kapoor ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the value coming from?
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
user enters it in a
<input type="text"....>
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
request.getParameter("param_name");
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a question though, how would i make it work if the user changed the value...
like an "onchange"

this is what i do currently:
<%
String pin = request.getParameter("analyst_pin");
session.setAttribute( "analpin", pin);
%>

obviously this will work only once. how would i do it for onchange
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
onchange is a Javascript event that takes place on the client machine.

All of your JSP code take place on the server.
Whatever value is sent when the form is submitted is what you will get using request.getParameter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic