I have index.jsp , i need to include a header.jsp in that.The problem is – header.jsp contains dynamic menu (for loggedIn users and for non-loggedIn users) i can check if user is logged in or not using session in index.jsp. but not in header.jsp
How can i include header in this situation ??
Can i access session object in header.jsp anyway?
Add conditional statement in
header.jsp. (Presume that the you’ve session key namedisloggedthat represent a status whether a user is logged or not)EDIT :
@I don’t have any session key maintained..but I would like to ..How can I do this?
Create a servlet, compare username and password in doPost() method, set session key-value if user is authenticated.
You can verify a user (whether he/she is logged or not) by checking a session key-value in filter.