0

This is a best practice question in JSF (2.2) to advanced Java EE developers.

In my Java EE project with JSF frontend I have a lot of implicit navigation rules in the two ways of:

<h:commandButton value="Link 1" action="pageXY" />
<h:commandButton value="Link 2" action="#{pageBacking.doAction()}" />

Now I moved lots of pages from the webapp diretory to the subdirectory webapp/user.

Because of the implicit navigation rules scattered over the whole huge project, it would be a costly approach to search/replace every occurence of every moved page. Especially if I would move pages in future again.

My Question

  • Is there a convenient way to refactor page moves (in Eclipse)?
  • Is there a better approach or a pattern how to define flexible navigation in JSF 2.2?
    • If sb. would advice explicit navigation rules in the faces-config.xml as used prior to JSF 2.0, which right to exist has implicit navigation then?
Thomas Steinbach
  • 1,019
  • 1
  • 9
  • 19
  • What a pity. I meant `commandButton` instead of `actionButton` and corrected it in my question. Thank you too for the hint with "JEE". I corrected it too. – Thomas Steinbach Jan 09 '15 at 15:16
  • 2
    This is indeed the awkward downside of implicit navigation cases. I'd bite down the bullet and spend one hour or two performing find&replace (Eclipse's one also supports regex and filtering and such which should speed up it). You'd be finished before getting answers on this question ;) – BalusC Jan 09 '15 at 15:18
  • Thank you for your opinion BalusC. I can imagine that there is withour good tool support no solution for matching implicit navigation rules to moved pages. Are then declared navigation rules in the faces-config.xml a better approach? Or is implicit navigation the lesser evil? Thank you too answering http://stackoverflow.com/questions/15521451/how-to-make-url-reflect-the-current-page-and-not-the-previous-one . I moved the pages to `/user/*` to secure them with web module security matching that URL and struggled with displaying the login form _before_ entering that space. faces-redirect helped – Thomas Steinbach Jan 09 '15 at 15:56

0 Answers0