jeudi 3 décembre 2015

If clause multiple condition jsp

I have problem with if clause for the multiple condition

here is code

<% if(session.getAttribute("userid")!=null && session.getAttribute("type")=="admin"){ %>

and this is for set attribute for session

if (resultset.next()) {
    String type = resultset.getString("type");
    session.setAttribute("userid",n);
    session.setAttribute("type", type);
    response.sendRedirect("company.jsp");
} else {
    out.println("Invalid password <a href='index.jsp'>try again</a>");
}

It doesn't work. How fix it?

Aucun commentaire:

Enregistrer un commentaire