Dynamic sub view with Pretty Faces

Splash Forums PrettyFaces Users Dynamic sub view with Pretty Faces

This topic contains 10 replies, has 3 voices, and was last updated by  kency 11 years, 3 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #17795


    Hello Lincoln

    before using JSF and Pretty Faces, i use JSP .

    i have one page and it just change content in it, header and footer was keeped.

    i use getParameter for do it


    url: http://localhost/myapp/index.jsp?page=item



    in index page my handle code:

    if(request.getParameter(“page”) == item){

    <jsp:include page =”item.jsp”/>


    with Pretty Faces how can i do it??

    i write one method in backing bean for handle dynamic content for JSF page follow:

    public String getIncludePath(){


    //do something



    in question mark i dont know what i will compare like jsp request.getParameter(“page”)==item?

    in JSF will follow:

    <ui:include src=#{bean.includePath}/>

    how can i do with Pretty Faces like JSP dynamic content view

    i was read User Guide and do follow it in pretty-config.xml:

    <url-mapping id="mainRegister">
    <pattern value="/register" />

    <url-mapping id="step1register">
    <pattern value="/register/#{reg:step1}" />

    <url-mapping id="step2register">
    <pattern value="/register/#{reg:step2}" />


    in JSF ManagedBean i write one method do it such as:


    public String getIncludePath(){


    return “registerStep1.xhtml”;

    }else if(reg==step2){

    return “registerStep2.xhtml”;

    }else if (reg == null){

    return “mainregister.xhtml”;



    but it not work.

    Please help me!

    Thank You !

    Best Regards



    Pleas help me !!



    no one help me? :((


    Hi Kency,

    It’s the weekend right now. Most people are not “at work” and should be able to help you Monday.

    Thanks for your patience,




    Hi Lincoln ,

    Sorry you, i will wait for you in Moday!

    Thank You


    Did you take a look at the DynaView feature of PrettyFaces?


    This may be a better way of solving your problem as you won’t need to dynamically include views in some kind of master file. You can use standard Facelets/VDL templating to include your header and footer.



    Hi Chkal DynaView is good!

    But i want dynamic pattern ex: home/ <=== index home/login <== login page

    i want content and url dynamic but page still keeped

    if i want user read the rule of site and click on commandButton and content will change and url will change

    Thank for your support!


    But why do you want the page to be kept while changing the URL and the content? Is it because you don’t want to duplicate the header and the footer in each file? In this case you should really use Facelets/VDL templates:




    Hi Chkal you right i don’t want to duplicate header and footer , i want change URL because when user want to access page he want, he can access through URL,and content will change when it getParameter like JSP http://localhost/index?page=value , value is page user want to access , for this purpose, i don’t know how do it with PrettyFaces . Thank for your response

    I will read Facelets/VDL template !

    Thank you!


    Try reading this section of the documentation as well. It may help you:




    Thank you Lincoln and Chkal, i was solved my problem with VDL templates , it greats !!

    Many Thank to You

    Best Regards

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

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.