This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Navigation rule not working

 
Scott Stephens
Greenhorn
Posts: 23
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a string literal "LOGOUT" as action that should trigger a navigation rule:


Here the faces-config.xml


the first rule for navigation to the right page following login works good. My logout <t:commandNavigation ´... action="LOGOUT"> however doesnt. The browser URL shows only http://localhost:8080/Perso/index.xhtml#
What is wrong? Maybe someone has an idea.
 
Scott Stephens
Greenhorn
Posts: 23
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrapped the navigation panel with a <h:form> tag . Now it works. Apparently, a POST OR GET REQUEST is necessary to send the string literal to the web server. I assume this is taken care of by the <h:form> tag.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18008
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct. JSF operates primarily via a series of postback operations done via HTTP POST. For HTTP POST, a form must exist, and to get the extra indicators that help JSF process propertly, it should be a JSF "h:form" or equivalent and not a bare HTML FORM tag with ACTION=POST on it.

This is true even for "hyperlink" tags such as h:commandLink and for menu tags, since, unlike bare HTML A HREF= tags, they will go through the JSF postback engine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic