Re: Form action is not rewritten correctly?

Splash Forums PrettyFaces Users Form action is not rewritten correctly? Re: Form action is not rewritten correctly?

#21196

Ok good news; I figured out the cause of your issue.

You’re not actually using DynaView in your project:

`<url-mapping id=”menue” parentId=”start”><br />

<pattern value=”#{menueEntryName : testBean.menueName}/” /><br />

<view-id value=”/empty.xhtml”></view-id><br />

<action>#{testBean.getViewPath}</action><br />

</url-mapping>`

You are just calling an action method and returning a navigation case, at which point JSF renders that view, but it cannot change the form URL because the form URL does not exist in any url-mapping!

You need to do this instead:

`<url-mapping id=”menue” parentId=”start”>

<pattern value=”#{menueEntryName : testBean.menueName}/” />

<view-id value=”#{testBean.getViewPath}”></view-id>

<!– Notice that the method ID is in place of the ViewId – this is how DynaView works. You’ll no longer need an action unless you want to rum some code when the page is accessed. <action>#{testBean.getViewPath}</action> –>

</url-mapping>`

Hope this helps :)