[JAVAEETUTORIAL-156] guessnumber example: confusing URLs Created: 22/Feb/13 Updated: 28/Mar/13 Resolved: 28/Mar/13
|Resolution:||Works as designed||Votes:||0|
|Remaining Estimate:||5 minutes|
|Time Spent:||Not Specified|
|Original Estimate:||5 minutes|
The guessnumber example (http://docs.oracle.com/javaee/6/tutorial/doc/gipob.html) displays http://localhost:8080/guessnumber/faces/greeting.xhtml in the address bar of my browser when I'm on the response.xhtml page and http://localhost:8080/guessnumber/faces/response.xhtml when I go "Back" to the greeting.xhtml page.
I don't know all the possible ways of correcting this, but one that works for me is changing action="greeting" to action="greeting?faces-redirect=true" in the response.xhtml File.
|Comment by swiss-chris [ 27/Feb/13 ]|
The same happens in the bookmarks/ application.
|Comment by Kim Haase [ 28/Mar/13 ]|
The fact that a displayed URL always lags behind the displayed page is a result of the fact that Facelets uses POST rather than GET. If you force a redirect, this causes more server resources to be used and, in complex applications, may lead to erroneous results.