• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing Variables from jsp to servlet  RSS feed

 
Michael Melamu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
i have some variables defined in my jsp document like this :



Now i have a servlet that i need to pass this variables to it

i have a submit form that call the servlet like this



But i cannot get access to this variables,what is the way to get to this varibales from the servlet?

Thanks

MIchael
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a legacy JSP? Modern JSPs should not contain Java code.

In any case, of course there can be no passing of the data from the JSP to the target of the form submission. Remembeer that the sole purpose of the JSP is to generate an HTML page to send to the browser. Once that happens, the JSP is long gone.

You'll either need to use hidden inputs in the form to carry the data, or store the data in the session for later retrieval.
 
Michael Melamu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll either need to use hidden inputs in the form to carry the data, or store the data in the session for later retrieval.


And how do i do that if i may ask?

Thank you very much for the quick reply
 
Jonas Isberg
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Melamu wrote:
You'll either need to use hidden inputs in the form to carry the data, or store the data in the session for later retrieval.

And how do i do that if i may ask?
How about starting with google?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!