• Post Reply Bookmark Topic Watch Topic
  • New Topic

java /jsp hidden fields  RSS feed

 
giri shetty
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • 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"
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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 ]
 
Frank Brown
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Scriptlets bad, JSTL good, JSTL 1.1 better."
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!