wood burning stoves 2.0*
The moose likes Spring and the fly likes SimpleFormController. HTML action left blank. Spring creates action under WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "SimpleFormController. HTML action left blank. Spring creates action under WEB-INF " Watch "SimpleFormController. HTML action left blank. Spring creates action under WEB-INF " New topic
Author

SimpleFormController. HTML action left blank. Spring creates action under WEB-INF

Edward Winchester
Ranch Hand

Joined: Sep 16, 2009
Posts: 65
Hello,

I posted this at springsource.org but didn't get any replies. Wonder if anyone has witnessed this before?

Spring is generating an HTML form action attribute under WEB-INF. This leads to a 404 when submit it pressed. Here's a bit of background into my very small app:

I have a controller to handle login. It extends SimpleFormController:


Also have a "standard" view resolver:


Here's my login form from the JSP page (note the action is not specified):


I'm developing this application on 3 different computers (depending on where I am location-wise). On 2 of the computers, when the form is presented in the browser and I look at the HTML source, the HTML form tag's action attribute is "/test/agentLogin.htm". This is as I would expect.

On the 3rd computer, I get the following: "/test/WEB-INF/jsp/agentLogin.jsp". This then leads to a HTTP 404 error when submit is pressed.

If I hardcode the action attribute in the JSP to "/test/agentLogin.htm" all's fine.

Questions:
  • Am I being sloppy in missing out the action attribute? This page says it's not required.
  • Could this be a bug in Spring showing itself under certain circumstances?


  • Thanks,

    Ed
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: SimpleFormController. HTML action left blank. Spring creates action under WEB-INF
     
    Similar Threads
    IllegalStateException:Neither BindingResult nor plain target object for bean name available
    problem while loading the welcome page
    Unable to call Controller method after form submission using Spring MVC 3
    need help with basic spring mvc program... please help
    Binding problem in JSP with Spring