Any reason you don't use implicit navigation without verbose XML config files? Btw: your problem lies somewhere else. The code shown as far looks fine. So either you aren't showing the minimum code which reproduces the same problem in your environment or you aren't running the code you think you're running.
–
BalusCAug 17 '10 at 13:31

You mean declaring the link via h:outputLink? I could try this As far as the code is concerned: I tried the navigation code in my real project and it didn't work so I set up a new Dynamic Web Project in Eclipse with JSF 2.0, copied and renamed the generated index.xhtml file and set up the above navigation rules. Nothing more, nothing less.
–
TimAug 17 '10 at 13:44

1

No. Just <h:whatever action="filename">. It'll implicitly go to filename.xhtml. For real assistance, you should provide the minimum code and environmental details which reproduces the problem. The above doesn't. It looks fine and should work fine. Maybe you've cut too much off from the actual code for posting here. You shouldn't do that. You might have unawarely fixed the problem with exactly that cutoff.
–
BalusCAug 17 '10 at 13:51

I've now listed all the code above. It is just a real small demo project I've set up to test the navigation rules. No java-classes,css, ..exist in this project
–
TimAug 17 '10 at 14:48

1

Sorry, I still can't reproduce this. Only thing which I've changed is ripping off those resource bundle declarations since I don't have those files here and they are irrelevant to the problem.
–
BalusCAug 17 '10 at 17:47

2 Answers
2

There are a lot of reasons for commandlink/button navigation not working, the common ones being:

h:form is missing.

h:form is nested inside another h:form.

Validation or conversion error has occurred.

There are more, but that's as far not relevant yet I think. The code in your question is not the actual code. It looks fine and should work fine (if you add the <html> tag with correct xmlns declarations).

If in vain, I suggest to debug the POST request. What JSF phases were entered/executed? What code got executed and what not?

See also:

Try adding redirect to the navigation URL, eg. action="next2?faces-redirect=true" or a <redirect /> element to the navigation case.
But basically h:commandLink is a POSTing component, not a GETting one. Better to use h:outputLink in this case IMHO.

This won't fix the actual problem. It just turns POST into GET using PRG pattern. However, the POST/navigation apparently hasn't taken place at all, so there's already nothing to turn into a GET.
–
BalusCAug 17 '10 at 13:28

Still doesn't work with the redirect-parameter
–
TimAug 17 '10 at 13:31