How to add parameter to url for every page in JSF?

416 Views Asked by At

I want to add a parameter to every page in my application in order to recognise users by url. Url parameter will be user specific and it will occur in every page url.

1

There are 1 best solutions below

0
On

You can add parameter to your url as follows

/myPage.jsf?faces-redirect=true&includeViewParams=true&ua=V

and later you can set that value to your jsf bean using <f:viewParam> component as follows

<ui:define name="metadata">
        <f:metadata>
            <f:viewParam name="ua" value="#{myBean.userActionFromUrl}"/>
        </f:metadata>
</ui:define>