Hi All, I tried the struts_beer sample program,exactly the same way in the book page740.But it is not forwarding the request from form.jsp to servlet.In the address bar it is changing as SelectBeer.do,but it is showing the same form.jsp.Can anyone help how to debug about forwarding in this program?
Originally posted by kathir vel: I tried your code in form.It was working first.But second time just I opened that page.Again it is showing the same problem.
The reason why it was so hard to troubleshoot was that your validate method was sending back an error, which causes the app to navigate back to the form page (as defined by the input attribut of your ActionMapping in the struts-config.xml file). Unfortunately, you apparently don't have an html:errors or html:messages tag in your form page to display the error and tell you what went wrong.
Your forwarding fails because validation is not passing. That's part of how Struts works. You need to get an html:errors tag set up properly on the form page or do something (like my previous recommendation) to understand when and why validation is failing. [ October 31, 2007: Message edited by: Marc Peabody ]