Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Passing Variables from jsp to servlet

 
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
 
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
 
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!