I integrated Tuckey UrlRewrite filter in my JSF application. My URLs now look like:

http://localhost:8080/myapp/page

instead of

http://localhost:8080/myapp/faces/page.xhtml

The problem is that my JSF forms submits to the old url

http://localhost:8080/myapp/faces/page.xhtml

and I am getting a FacesFileNotFoundException.

How can I solve this issue?

有帮助吗?

解决方案

You've to implement a custom ViewHandler and override the getActionURL() method to return the desired form action URL. That's where the forms get its action URL from. This is by the way also what PrettyFaces, the JSF URL rewrite solution, does. You may want to use it instead of reinventing the same wheel. It's by the way open source, so you could just peek around in its source code to see how they did it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top