[solved] Constant URL in JSF application

Splash Forums PrettyFaces Users [solved] Constant URL in JSF application

This topic contains 2 replies, has 3 voices, and was last updated by  Lincoln Baxter III 7 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17753

    sumukh
    Participant

    Hello there,

    We have a requirement where we need to keep the constant URL in browser address bar.

    End user might visit different JSF pages but we do not want to modify the URL.

    We are using MyFaces 1.1.6 on WAS 6.1 with JSP as a view technology.

    I am not sure on how do we achieve this using pretty faces. Any pointers/directions are most welcome.

    Thanks

    Sumukh

    #19991

    I doubt that PrettyFaces is suitable in this case, as the concept of PrettyFaces is to embed information (query and/or path parameters) in the URL, which conflicts with your requirement.

    You could try to build some kind of master view, that conditionally renders other views (would be easy when you are using Facelets). The conditional rendering should be controlled by some kind of master bean, which is kept alive in the master view via <t:saveState/> or <a4j:keepAlive/> and knows the currently visible sub view. This bean could control which view is rendered (on which “page” the user currently is).

    This would constantly show one URL in the browser’s address bar.

    #19992

    I have to both agree and disagree.

    First, this *can* be done using PrettyFaces:

    <url-mapping id="home">
    <pattern value="/constant/URL" />
    <view-id> #{bean.getViewPath} </view-id>
    </url-mapping>

    The above mapping uses a Dynamic View ID:

    http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/Configuration.html#config.dynaview

    Which can be used to display any number of pages under a single URL, however, using PrettyFaces with JSF 1.1.x is provided only for legacy users. If you encounter any issues, you are on your own for fixing them, unless they also impact one of the newer versions.

    –Lincoln

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.