0

I have started a Spring-JSF application. I've broken down this application into some separated modules that should be archived and deployed separately as well. For example:

  1. A main module which handles the login, page templates, loading and showing the menu and so on.
  2. Another module handles the business specific views and logic, for instance: Employee.xhtml

So after the user passes the authentication, in the index page, he/she want to navigate to Employee.xhtml page which is in the second module (So it is deployed on tomcat in the separate war file).

In this situation, when I deploy both WAR files on tomcat, main application cannot find the Employee.xhtml in the second WAR file, or something like this. I'm getting this error:

    java.io.FileNotFoundException: Facelet /pages/Employee.xhtml not found at: jndi:/localhost/pages/Employee.xhtml
        org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createFacelet(DefaultFaceletFactory.java:387)
        org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.access$000(DefaultFaceletFactory.java:57)
        org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:124)
        org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$1.newInstance(DefaultFaceletFactory.java:121)
        org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getFacelet(FaceletCacheImpl.java:84)
        org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getFacelet(FaceletCacheImpl.java:51)
        org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:278)
        org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:574)
        org.apache.myfaces.view.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:553)
        org.apache.myfaces.view.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:240)
        org.apache.myfaces.view.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:228)
        javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:55)
...

Also I'm not navigating between these two applications. That is I'm trying to include a page from second war file in the center area of a page in the first main war file.

Any ideas?! Any help would be appreciated.

STaefi
  • 4,297
  • 1
  • 25
  • 43

1 Answers1

0

The way to do this is no different than navigating to e.g. www.google.com. or in other words, you cannot use the way you'd navigate within a jsf application to navigate between two applications

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • Dear Kukeltje, thanks for the your contribution, but actually my problem is somehow different from navigating to another link, because I want to include another page(from second WAR file) into a page which resides in first WAR file. To be specific, I directly used facelets tag. – STaefi May 03 '15 at 04:31
  • Sorry I misunderstood (and your subject/title is wrong). Then the duplicate is this one:http://stackoverflow.com/questions/11965157/uiinclude-can-not-include-pages-with-different-server-context – Kukeltje May 03 '15 at 08:15
  • Really thanks kukeltje, it's very akin to my situation. I will give it a try. – STaefi May 03 '15 at 09:41