Answer to Question #493 in Java | JSP | JSF for sheeta sharma
Question #493
I have a problem with jsp. I am developing login.jsp. in this all the code of login is written. If username and password is in database then ok, it is running, but I want to print "invalid login" when username & password doesn't match with that of database. How can I do this?
Expert's answer
Let there variable "isLogin" in jsp code, that contains true if username and password match with that of database and "username" contains user name entered.<%
if ( isLogin ) {
%>
Hello, <%= username %> <%
} else {
%>
Invalid login <%
}
%>
if ( isLogin ) {
%>
Hello, <%= username %> <%
} else {
%>
Invalid login <%
}
%>
Need a fast expert's response?
Submit orderand get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment