• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Navigation rule not working

 
Greenhorn
Posts: 23
Eclipse IDE Tomcat Server Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Tomcat Server Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic