This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

java /jsp hidden fields

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys iam new to java can any one of u explain me what is the use of <input type='hidden> in any JSP page.how can we retrive this hidden values in servlet.
thanks in advance
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<input type='hidden'> is HTML markup. See the HTML Tutorial and References at w3schools.com (or any other good HTML reference) for more infomation. Basically hidden input fields are used to send parameters with a request (such as for a form) that the user does not directly set or change, like they would with a textbox of checkbox.
You can refrence the API for javax.servlet.http.HttpServletRequest for details on how to access the value in your JSP/Servlet but basically, in JSP:
input.jsp

then in the JSP that processes the page:

The variable request is an implicit instance of javax.servlet.http.HttpServletRequest in JSP's
HTH
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh, also in a JSP you could use JSTL (JSP Standard Tag Library) to access the value of the input parameter. That would actually be the preferred way. Sometimes I'm still stuck in pre-JSTL mode in my brain "Scriplets bad; JSTL good"
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
giri, please see my response to your post here.
Bear
JSP Forum Bartender
[ January 22, 2004: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Scriptlets bad, JSTL good, JSTL 1.1 better."
 
Destroy anything that stands in your way. Except this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic