0

I'm trying to create a common error page that can be used across many projects.

I'm trying to create a separate project called ErrorProject. All of my other projects will have a Maven dependency to this ErrorProject.

Let's say that I have created project A and there is an error, how can I show an xhtml page from ErrorProject when using project A in the browser?

Currently I have this in the web.xml of project A and error.xhtml is a page in the ErrorProject.

<error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/error.xhtml</location>
</error-page>

<error-page>
    <error-code>404</error-code>
    <location>/error.xhtml</location>
</error-page>
Dave Newton
  • 152,765
  • 23
  • 240
  • 286
Catfish
  • 17,019
  • 47
  • 183
  • 323
  • I have no idea how to do it with Maven, but to the point, you need to tell it somehow to accomplish the structure as shown in this answer: http://stackoverflow.com/questions/8320486/structure-for-multiple-jsf-projects-with-shared-code/8320738#8320738 – BalusC Jan 23 '13 at 18:18

1 Answers1

2

Is it your error project a web project which creates a war? If it is just put the /error.xhtml into src/main/webapp. Then you can add the dependency and Maven will do an overlay, including it into main application's web root directory, so you can reference it from web.xml.

Xtreme Biker
  • 28,480
  • 12
  • 120
  • 195