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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -