• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

set req attr in jsp from a text field

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wanted to know if it is possible to set a value entered in a text box to be set in a request as a request attribute in the jsp itself while submitting. What I mean is this :
I have user name and password fields that the user enters and there are two links to login and registration. If he clicks registration instead of login I want to be able to populate the user name and the password fields in the registration page instead of the user typing it again.
I wanted to know what is the value that I need to set in the request attribute so that the user name entered in the text field is set in the request attribute.
I wanted to know if it is possible?


Thanks,
Samanth.
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming your text fields are posted in a form and your link is actually submitting the form, then the values are already in the request (as parameters). This is the way you should do it IMO. You can change the action of the form with javascript when the user clicks the link, depending on which link they click on. You can then use javascript to submit the form.
 
Sheriff
Posts: 67503
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Samanth Marisetty:
set req attr in jsp


Please use real words when posting to the forums. Abbreviations such as "req" in place of "request" and "attr" in place of "attribute" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Bear Bibeault
Sheriff
Posts: 67503
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I wanted to know what is the value that I need to set in the request attribute so that the user name entered in the text field is set in the request attribute.

There is no magic value that can make this happen, you need to code it yourself. In the case that you mention, simply put the information on the request before forwarding to the page, and have the JSP on the page populate the value attribute of the text fields.
[ February 25, 2008: Message edited by: Bear Bibeault ]
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic