I have a problem with the JSF 2.2 Feature
.
I placed this tag in my XHTML-Page, it\'s called viewActionStart.xhtml<
The <f:viewAction onPostback="true">
applies only on postbacks on the very same view. I.e. it runs only when a <h:form>
in the very same view has been submitted. The <f:viewAction>
is never intented to be executed upon POST navigation triggered by a submit of a <h:form>
of another view. Moreover, the term "postback" in the attribute name also confirms this. This term means in web development world "a POST request on the URL of the page itself".
You need to open it by a GET request instead of a POST request. Replace the <h:commandButton>
by <h:button>
:
<h:button outcome="viewActionStart.xhtml" value="To f:viewAction Page" />
(note: the <h:form>
is not necessary anymore)
Or, if you really intend to perform a POST request first for some unclear reason (it would have been a bit more understandable if you were invoking a bean action method, but you're here merely navigating, so the whole POST request doesn't make any sense), then let it send a redirect:
<h:commandButton action="viewActionStart.xhtml?faces-redirect-true" value="To f:viewAction Page" />
Either way, the URL should now be properly reflected in address bar. This was at its own indeed a strong hint that you was donig things the wrong way ;)