1

My scenario is this:

I have a template with some base code for my application. This template has some custom renderers and some beans in the faces-config.xml file.

Then I have my application that inherits the base code from the template and this application has some additional beans. And everytime I refresh from the template I need to manually add the "local" application beans into faces-config.xml.

Is there a way to have multiple faces-config.xml files or is there another way to fix this problem?

Fredrik Norling
  • 3,461
  • 17
  • 21
  • Perhaps a VariableResolver, checking whether it resides inside base or child application? – Lauri Laanti Jan 21 '14 at 09:40
  • You can bundle faces-config into JAR together with beans. Unfortunately, I have problem with that: http://stackoverflow.com/questions/9604715/faces-config-xml-in-jar-file-behaves-differently-on-two-dominos. – Frantisek Kossuth Jan 21 '14 at 10:31
  • Which JSF version-impl are you using? – Aritz Jan 21 '14 at 12:01
  • Well, it's IBM XPages that is what I know based on JSF 1.2 – Fredrik Norling Jan 21 '14 at 12:33
  • 1
    This sounds like a perfect use case for an OSGi plugin: shared features applied to an application that, in turn, has its own custom behavior. An XSP Library supports multiple faces-config files because there's an explicit method for declaring which files to load. An NSF, on the other hand, assumes it contributes only one of its own. – Tim Tripcony Jan 21 '14 at 12:58
  • No idea what role "xpages" plays here, but this is definitely possible with standard JSF. See also among others http://stackoverflow.com/questions/19277637/jsf-faces-config-xml-with-external-navigation-rules-xml-file/19277793#19277793 – BalusC Jan 21 '14 at 13:16
  • @TimTripcony Probably would be a good idea. but the deployment of the app will be a pain. Want to contain it into a nsf file, if that can't be done. Editing the file will be best. – Fredrik Norling Jan 21 '14 at 14:57
  • Fredrik with OSGi it will be contained into 2 NSF: your app and the update site. It is less painful than it sounds. @TimTripcony move your comment to the answer, its good. – stwissel Jan 22 '14 at 08:23
  • @stwissel I don't think it's painful but the all admins that needs to deploy this into 100+ servers,will. – Fredrik Norling Jan 23 '14 at 09:43
  • And, Yes @TimTripcony move your comment to an answer. – Fredrik Norling Jan 23 '14 at 09:44
  • 1
    Be a nice guy then... provide a script that creates all the replicas of your database on all servers and updates the notes.ini. Use this as starter http://www.wissel.net/blog/downloads/replicateall.html – stwissel Jan 24 '14 at 08:59

1 Answers1

1

This sounds like a perfect use case for an OSGi plugin: shared features applied to an application that, in turn, has its own custom behavior. An XSP Library supports multiple faces-config files because there's an explicit method for declaring which files to load. An NSF, on the other hand, assumes it contributes only one of its own.

Tim Tripcony
  • 8,056
  • 1
  • 23
  • 34