Hello,
I'm using Struts 1.2.4 (along with the validator framework), and I've noticed that for my forms that do a Post, the action class is executed twice. I put log statements in my Action class, in the validator classes, in the Struts ActionServlet, and in the JSP to try to figure out what is happening. The sequence of events is as follows:
- User presses Update button on a JSP - doPost method invoked (ActionServlet) - Struts validation methods invoked - execute method (Action class) entered - execute method (Action class) returns forward action of Success - processing returns to the same JSP ......................................................................... - doGet method invoked (ActionServlet) - Struts validation methods invoked - execute method (Action class) entered - processing returns to the same JSP - web page is displayed on browser
Everything prior to the doGet looks normal. I can't understand why the JSP submits a Get request when it should display. The method specified in the JSP's form (there is only one form in the JSP) is a Post, not a Get. The JSP does not contain any form submission via JavaScript.
I also notice that if I change the method in the JSP's form from Post to Get, this problem goes away: the form is submitted only once!
In a related problem, I have a JSP that does have a form with a method of Get, but the user never clicks on a button to submit the form. Instead, the user clicks on a link with a value like: http://localhost:8080/pets/action/petDetail?userAction=Display&type=Pet&id=2. I expect processing to go to the Action class associated with 'petDetail'. Processing does go there, but first a 'doGet' is processed in the ActionServlet, even though a form was not submitted.
Has anyone seen these problems or know what is happening here? Thanks very much for your assistance.
Dom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]