Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp based login page  RSS feed

 
Udhayya Gethan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Need your help guys

I created a jsp based log in page
then if the log in details are not correct i print " Incorrect log in details" and vice verse using jsp

but the problem is before the html form is submitted the jsp part prints incorrect credentials error

please help me with this

i wanna display the details only after the form is submitted

and give me some ideas about how to print the value "incorrect username" or "incorrect password" in the text boxes in the form

waiting fwd for your replies
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, why is there Java code in the JSP? Is this a legacy page from about 12 years ago? If not, and this is new code, there should be no Java code in the page. Please read this JspFaq entry.

But to answer your question, yes, the JSP executes on the server before the page is even sent to the browser. So you've put the cart before the horse here. Please read this article to understand how JSP works.

The code to process the submitted form should not be in the JSP; it should be in a servlet that the JSP submits the form to. This servlet will execute after the form is submitted.

You night also want to read this article to see how moderne web apps should be structured.
 
Linux Maniac
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Bear Bibeault!! check your line number: 31 and 48. its making me confuse ...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!