Win a copy of Spring Boot in Practice this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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: 67651
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."
 
reply
    Bookmark Topic Watch Topic
  • New Topic