|
-
March 6th, 2012, 04:21 AM
#1
How to redirect to login page if not logged in
hi,
i have a tomcat web application and it is working properly. i have only javascript and jsp but if user types any url of any jsp without login its displaying that page for that i written the code like this in jsp.... but its not working........ so any one please help me...........
the code is
<% if(null == session.getAttribute("username")){
response.sendRedirect("./jsp/logout.jsp");
}else { %>
<a href="../jsp/useradmin.jsp?">Add User </a> <%} %>
this is not redirecting to login page if i entered url useradmin page directly without login. any one please tell me sollution..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|