JSF Incorrect Form Action
I posted this in the JSF Forums, but they passed the buck and told me to post it here.
I am using Spring MVC 2.5 with JSF, and I'm running into a weird issue with the action attribute on the form tag.
My application has a URL structure similar to http://webadress.com/org/user/edit. This is setup in the following way:
PHP Code:
<bean id="faceletsViewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.faces.mvc.JsfView" />
<property name="prefix" value="/WEB-INF/pages" />
<property name="suffix" value=".xhtml" />
</bean>
I also have a simple form, similar to the following:
PHP Code:
<h:form id="someFormName">
... contents of the form ...
</h:form>
The problem arises when the form is rendered to the page and the action tag is generated. Instead of posting back to the current page (/org/user/edit), it posts back to the path that the file was pulled from.
It does this...
PHP Code:
<h:form id="someFormName" action="/WEB-INF/pages/org/user/edit" ...>
... contents of the form ...
</h:form>
Instead of this...
PHP Code:
<h:form id="someFormName" action="/org/user/edit" ...>
... contents of the form ...
</h:form>
Therefore, it posts to a page that is not accessible. I'm really not sure which framework is causing this or where/how to configure this.
Any help is greatly appreciated! Thanks...
there has to be a solution
Hey,
there has to be a solution! I have exactly the same problem but I am new to Spring. I am working on a dynamic CRUD controller with RESTful URLs and JSF-Views.
https://jira.springsource.org/browse/SWF-1341 seems to be solved but I am not able to see the solution. I've also consulted big google without success.
Help, pls.
regards,
Max