where should we place HIDDEN variable in JSP

Posted by micheal on Stack Overflow See other posts from Stack Overflow or by micheal
Published on 2010-03-18T14:00:33Z Indexed on 2010/03/18 14:21 UTC
Read the original article Hit count: 357

Filed under:
|

I need to use Hidden variables in my JSP for session tracking. this is the code:

<input type="hidden" name="REQ_TOKEN" value="<%=session.getAttribute("SESN_TOKEN").toString()%>" />

i am using this to compare the request token with session token, so only when both are equal i will evaluate that request otherwise i will throw an error.

Now the problem is, when i place this code inside <form></form> tags, it is working fine. Unfortunately there are some JSPs in my application where we dont have tag(I know that sounds weird!). where can i place my code so that it will work?

Cant i use Hidden variables without FORM tag???

© Stack Overflow or respective owner

Related posts about jsp

Related posts about html