h:commandLink has stoped working after adding prettyfaces

Splash Forums PrettyFaces Users h:commandLink has stoped working after adding prettyfaces

This topic contains 2 replies, has 2 voices, and was last updated by  javi2ee 5 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #27399


    Hi, I’ve added PrettyFaces to an application and everything is working as expected except for one thing.

    First of all the project is based on:
    JSF2.2(Primefaces 5.3)
    SpringSecurity 3.2

    The problem is that all commandlinks that worked previously have stopped doing so, I’ve updated the action values so if it was

    <h:commandLink value="go" 

    now it’s

    <h:commandLink value="go" 

    having in my pretty-config a tested working mapping:

    <url-mapping  id="proveedores">
    		<pattern value="/compras/proveedores" />
    		<view-id value="/os/compras/proveedor/List.xhtml" />

    The form get submitted and a browser refresh/redirect occurs but to the same page where the commandLink get invoked.
    I’ve tried action=”/compras/proveedores” and the original action value too without success.

    There is not any error in log and I can’t figure what is failing here, I attach a file with web.xml, and pretty-config.xml for if relevant.

    Thanks for your help.


    After posting the web.xml I’ve noticed that the project was on production stage, after changing it to development i’m getting a faces message:

    Can not find the event ID matching navigation view ‘ /os/dashboard.xhtml ‘ for the { 1} ‘ with the result ‘ {2 } action ‘

    being /os/dashboard.xhtml the page not ‘pretty-faced'(I mean the real/original page), where i invoke the commandLink.

    Sorry for possible grammar or spelling mistakes

    • This topic was modified 5 years, 8 months ago by  javi2ee.
    • This topic was modified 5 years, 8 months ago by  javi2ee.
    • This topic was modified 5 years, 8 months ago by  javi2ee.
    • This topic was modified 5 years, 8 months ago by  javi2ee.

    You don’t need to change the action of your commandLinks. So something like this should work:

    <h:commandLink value="go" action="/os/compras/proveedor/List.xhtml?faces-redirect=true/>

    The action attribute must always refer to the view id and NOT to the pretty URL.

    But please note that creating such commandLinks is bad practice as it creates a postback followed by a redirect to the new page. The postback is unnecessary. Just use h:link instead which will create a standard HTML link to the new page:

    <h:link outcome="/os/compras/proveedor/List.xhtml">go</h:link>

    Back to your original problem. Could you please check your dependencies? Make sure you have the rewrite-integration-faces module in your dependencies. This one is required for the JSF integration.



    Hi Christian, I’m using commandLink because actually it’s invoking a managed bean that return a dynamic navigation case and is also performing other operations, in my previous message I gave a simplified example of the case to abstract the problem, but thank you for the tip, I didn’t know it.

    The original problem has been solved after adding that dependencie and changing the bean to return the view id, thank you very much,
    I really appreciate your help.

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.