Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Passing parameters to the servlet

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before when using the dreaded invoker servlet it was possible to pass the servlet the value of an ever-changing productID by doing something like this <a href="music/adminServlet?productID">

Is there a way to pass the servlet the value of productID by clicking on a hyperlink (generated dynamically) in my JSP page (that runs the servlet by way of servlet mapping through the web.xml file).

I know I could do it with servlet init params but I want the productID to be sent at runtime and not hardcode thousands of servlet mappings.
Also I know I could set a request or session attribute, but if you click on a hyperlink is it even possible to set one of these attributes?

Thanks,
Newbie in need of help
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whether the invoker is used or not is irrelevant to the ability pass parameters in the query string.

Did you try it?
 
paul Staniland
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it's working now, thanks!

I did try that before but it didn't work (due to an incorrect web.xml file i now realise!)
 
Good night. Drive safely. Here's a tiny ad for the road:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic