html - Redirect to the same page but with a message in it -
I am creating a login page in JSP. I have a My issue is after entering the user name and password, when I Pressing the login button, I have How should I show the appropriate small message below the login box on the same You can use the object here: in index.jsp page, where there is a present form and some javascript writers. In the database, check for username and password in
check1.jsp file
check1.jsp linked to the form, if the user matches the username and password and exists, then it is
welcome.jsp Redirects to, but if the username does not exist or the password is found If not, then I'm returning a small message under the
index.jsp box that the username is not present or the password does not match , currently I only
Redirected to index.jsp .
index.jsp page ??
check1 .jsp :
redirect (loginSuccess) to {// welcome.jsp} {session.setAttribute ("error", "username or password is incorrect") ; // index.jsp}
index.jsp :
string msg = session.getAttribute ("error"); If (msg! = Null) {%> gt; & Gt; Style = "color: red" & gt; & Lt;% = msg% & gt; & Lt; / P & gt; Apart from this, there are more simple methods available with EL and JSTL, but this is for an initial tip.
Comments
Post a Comment