0

I wish to have a Master-Page, and switch content in this. I currently have it working by having the content pane of my masterpage defined by <ui:include src="#{navigation.currentPane}" />

The navigation bean holds the current navigation path for the content facelet. The content is updated with ajax.

Is this the correct way? Does it have any downsides?

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
  • 1
    This is not SEO friendly. You should do it the other way round so that every page has its own bookmarkable URL. – BalusC Dec 28 '12 at 12:01
  • Does this also apply if its content that should only be accesible while autenticated and logged in ? – Andy Vidkjær Dec 28 '12 at 12:56
  • Yes, just restrict access to those URLs by either container managed authentication or a homegrown filter (or a 3rd party authentication framework like Spring Security) – BalusC Dec 28 '12 at 12:57
  • So if i want that master-page apperance, what i should do is example have home.xhtml & forum.xhtml and then use a template header for an example to keep that consistent? – Andy Vidkjær Dec 28 '12 at 13:02
  • Something like as 2nd example of http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets/4793959#4793959 – BalusC Dec 28 '12 at 13:02
  • Thanks man! +1 to you kind sir ! – Andy Vidkjær Dec 28 '12 at 13:13

1 Answers1

0

It can be problems if you use ViewScoped beans. EL in src can lead recreating your bean with every request. With SessionScoped beans I think it works fine.

partlov
  • 13,789
  • 6
  • 63
  • 82