0

I have an existing application to modify. The requirement is to add a few static HTML pages (like about us, terms of use etc) to the existing home page, which is a JSF page.

I did research and found out that, to deliver a JSF page, there needs to be :

  1. xhtml page
  2. a Managed Bean
  3. an entry in the faces-config.xml.

My question is - is the managed bean required for even delivering the static pages?

So far, I have done this:

  1. Created aboutus.xhtml

  2. Snippet from home page with links :

    <h:link value="#{defaultPageBundle['about.us.link.label']}" outcome="aboutus"/>
    
  3. Current faces config for home page:

    <navigation-case>
        <from-outcome>home</from-outcome>
        <to-view-id>/home.jsf</to-view-id>
        <redirect/>
    </navigation-case>
    

    When I click the link, it goes to aboutus.jsf, but still shows my default home page. Should I add a managedBean to deliver each of these static pages? Or, am I really missing something in the workflow?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
janenz00
  • 3,315
  • 5
  • 28
  • 37
  • Why exactly do you think you need a managed bean? Do you need some model in the view? The navigation case is completely irrelevant by the way. It works as good without it as long as you use `` for page-to-page navigation. – BalusC Nov 14 '13 at 14:50
  • I do not need model. I just want to serve the static xhtml pages. I added the h:link, but it (say, aboutus.jsf) always shows the home page (default page) and does not serve my aboutus.xhtml. – janenz00 Nov 14 '13 at 15:07
  • If you don't need a model, then you also don't need a backing bean. Simple as that. – BalusC Nov 14 '13 at 15:11
  • And please stop putting tags in the title. I removed it for the second time. Users here browse by tags. If everyone put "JSF - " in front of a title here http://stackoverflow.com/questions/tagged/jsf then it would look very awkward and nonsensicial. – BalusC Nov 14 '13 at 15:14
  • Okay sure. My problem is, my xhtml file doesn't get rendered. can you see my edit? – janenz00 Nov 14 '13 at 15:14
  • Problem is not visible in information posted so far. Works just fine for me. Posting an SSCCE demonstrating the problem instead of asking a generic and conceptual question would help better in solving the concrete problem. – BalusC Nov 14 '13 at 15:15
  • May be the issue is with the fact that I am trying to edit an existing large application. Will try to come back and post a clear picture. However, the clarification about ManagedBean helps. – janenz00 Nov 14 '13 at 15:25

0 Answers0