• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Session Doubt  RSS feed

 
Jas Oberai
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I have an element of doubt...say if I have this form in my jsp page,which when submitted goes to a servlet.


From the servlet can I access the form parameters directly like this:

Or I need to set them first and then access them??
like this:


If yes,where to set them then??..please clear these doubt my friends.
Thanks
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These values will come from what the user typed into the form values on the JSP/servlet.

So if you have a field


on a JSP page this will display as a textbox where the user should enter their username. When they submit the form you get the value they submitted by doing
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or I need to set them first ...


Parameters and attributes (aka scoped variables) have nothing to do with each other.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. You ought to fix your topic subject. Your question has nothing whatsoever to do with the session.
 
Rohan Kayan
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is difference in Parameter and Attribute . You can't set a parameter , they olny can be get from the request.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!