This is a common problem. Search for how to handle sensetive form submission in JSP. 
Struts has functionality to do that.
John
----- Original Message -----
From: "Rajkumar, Haripriya (Haripriya)" <[EMAIL PROTECTED]>
Date:         Wed, 26 Jun 2002 12:36:04 -0400
To: [EMAIL PROTECTED]
Subject:      HTML Form submit action and JSP interaction...


> Hi,
>
> I am writing a simple login validation pgm. I have a HTML file which has the
>
> login form and it action points to a JSP page that needs to be displayed
> ONLY AFTER the
> user has been successfully validated.
>
> Also, I have a JavaScript file that holds function to check for empty fields
> in the form and
> sends an alert.
>
> Basically
>
> 1. If empty fields are present the JavaScript, alert needs to be called and
> the HTML form page
> should still be visible.
>
> 2. If userId and password are entered but are not valid, then the JSP page
> that prints out the
> error message has to be displayed.
>
>
> Here is what happens. When the HTML form is called in the browser, and
> userid or password is not entered
> then the alert is displayed properly. After entering the userid and
> password, it goes to the JSP
> page properly.
>
> BUT when, I use the browser's BACK button, and go to the HTML form page, and
> if the password field is not
> present and try to hit submit button, The Alert message is displayed AS WELL
> AS the JSP page too, seems
> like the SUBMIT action is getting called. How do I fix this, so that even if
> teh user, hits the
> BACK button and tries to login giving empty fields, ONLY the alert has to be
> displayed.
>
> Any pointers???
> Thanks
> PHR
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>

--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to