hi.
First things first!
Nothing can be submitted to server without the input field being inside the
FORM object, & moreover, you always submit the form. So first place the
<input type="hidden" ... /> inside a <form ... >..........</form> tag then
submit the form, next use the following code to get the submitted value in
you JSP.
String abc = request.getParameter("flag");
Regards,
Arun Karthik R
SIEMENS
#84, 1st Main, Keonics Electronics City,
Hosur Road, Bangalore - 560100.
* Contact :
Direct: +91 (080) 8091611
Board Line: +91 (080) 8521122. Extn 4611
E-mail : [EMAIL PROTECTED] < mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> >
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference [
mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ]On
Behalf Of Edward King
Sent: Monday, May 03, 2004 4:26 PM
To: [EMAIL PROTECTED]
Subject: How to get hidden value in JSP page?
There is a hidden value,named flag in a JSP page,like following:
<%
String abc;
//My question is whether there is a method to get hidden value of flag and
assign to variable abc?
//print the value of variable abc
System.out.println("hidden flag="+abc);
if(abc.compareTo("0")==0)
//do something
else
//do otherthing
%>
<html>
<body>
<input type="hidden" name="flag" value="0">
</body>
Thanks in advance!
Edward
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp <http://java.sun.com/products/jsp>
http://archives.java.sun.com/jsp-interest.html
<http://archives.java.sun.com/jsp-interest.html>
http://forums.java.sun.com <http://forums.java.sun.com>
http://www.jspinsider.com <http://www.jspinsider.com>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com