where should we place HIDDEN variable in JSP
- by micheal
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???