hi edward,
do you mean get the value in the following page or in the same page?
remember the HTTP protocol uses a request-response action, meaning that once
a page is loaded the java variables are assigned and can't be changed
dynamically, to do such comparisons with out loading a new page use
javascript.
on the following page the request.getParameter("flag"); should work if
you've submitted the form.
if the hidden variable doesn't change after the page gets loaded up then you
can just assign a java variable to the same value that the hidden value gets
assigned.
----- Original Message -----
From: "Edward King" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 03, 2004 12:55 PM
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://archives.java.sun.com/jsp-interest.html
> http://forums.java.sun.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