Manage session in a complete JSP project -
i developing shopping inventory system in simple jsp, servlet. when login user_id , password, doing session.setattribute("admin",admin). redirecting page wholesaler.jsp, doing session.getattribute("admin) , getting session value fine. problem is, whenever click on link of wholesaler.jsp page, redirects me login page. please !! code login page,
<% if(!password.equals(rs.getstring("password"))){ %> <jsp:forward page="admin_login.jsp"> <jsp:param name="msg" value="invalid authentication !! try again"/> </jsp:forward> <% } else{ session = request.getsession(true); session.setattribute("admin", admin); db.close_connection(); %> <jsp:forward page="/wholesaler transaction"/> <% }
code in wholesaler.jsp.
<%@page contenttype="text/html" pageencoding="utf-8" session="true"%> <% if(session.getattribute("admin")==null){ response.sendredirect("/sms/"); } else{ //load page } %>
thanks in advance guys..
its because using password validate in wholesale.jsp. check out. password field must empty next time click wholesaler.jsp page
if(!password.equals(rs.getstring("password"))){
Comments
Post a Comment