I'm new to Spring and i'm trying to implement a SimpleFormController and a form with the spring-form tag library. I have a DAO bean and an command object with the fields of the form. I also extended the SimpleFormController:
I have defined this form controller in the dispatcher-servlet.xml
When i try this form i get the following message from the glassfish server:
HTTP Status 404 -
type Status report
descriptionThe requested resource () is not available.
Sun GlassFish Enterprise Server v2.1.1
And if i look at the generated form HTML code i see:
Why is it refering to "/logintest/WEB-INF/jsp/testForm.jsp" and not to "/logintest/testform.htm" (the mapping of the controller)? is it something i missed in the documentation or something i should know about spring? The only reference to this issue i found using google is refering to Spring 2.0 and not giving a cause or solution. I am using Spring 2.5 (the one supplied with netbeans 6.7.1).
(html send to browser)
<form id="user" method="POST" action="/formtest/WEB-INF/jsp/userForm.jsp">
which results in a 404 message in the browser. Am i the only one experiencing this problem? then there should be something wrong with my configuration. Who can help me find out what i do wrong? i assume that the people from vaannila have tested there examples before publishing.
Thank you for your support but it is not working, the action tag in the form is still pointing to de "WEB-INF/jsp/testForm.jsp" in stead of the current page. I have googled a litle further on this issue ad therefor i want to ask you on which IDE and application server you tried it? it seems that this issue appears om the glassfish server which came with Netbeans 6.7.1, i found at least 2 others with the same issue and who are using the same IDE.
What i see is when i request for "http://localhost:8080/logintest/index.htm" that the form generated has the following request properties:
JSP Request Method: GET
Request URI: /logintest/WEB-INF/jsp/testForm.jsp
Request Protocol: HTTP/1.1
Servlet path: /WEB-INF/jsp/testForm.jsp
Path info: null
Query string: null
Content length: -1
Content type: null
Server name: localhost
Server port: 8080
Remote user: null
Remote address: 127.0.0.1
Remote host: 127.0.0.1
Authorization scheme: null
And as you can see in the source of the form:form tag the action attribute is extracted from the requestURI parameter. So assuming that glassfish is the reference implementation and the guys at spring are no idiots i assume that i must do something wrong, or is this a bug/feature?