PDA

View Full Version : The form:form tag - action



Kornel
May 28th, 2008, 07:01 AM
Hi,
I'd like to understand the basic property of the form:form tag, namely action. I'm using a viewResolver to hide the jsp's inside the WEB-INF folder as follows:


<bean name="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewR esolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
<property name="viewClass" value="org.springframework.web.servlet.view.InternalResou rceView"/>
</bean>

and next, I'm using the form:form tag in the jsp as follows:



<form:form>
...
</form:form>


under Sun Application Server 9.0 it renders the html as a correct <form> tag



<form action=myview.do">
...
</form>


but under Sun Application Server 9.1 I get


<form action=/WEB-INF/views/myview.jsp>
...
</form>


what is obviously wrong. I can fix it using the action parameter in the <form:form> tag, without any trouble, but I'd love to know which server (9.0 or 9.1) is wrong, and what is the expected behaviour :-)

Thanks in advance,
Kornel