0

AS you may know that when an API is prepared, it can be used in any project just by adding it into classpath in J2SE. I wonder if it is possible to create a web page and compiled it into a war file just like an API definition so that It can directly be used within an ear.

Ahmet Karakaya
  • 9,899
  • 23
  • 86
  • 141

1 Answers1

1

No, you can't do that using a war file, because a war file would define a new web application separated from the other ones.

But since the servlet 3.0 spec, you can do that with a jar file placed in the WEB-INF/lib directory of your war file, using the META-INF/resources directory of the jar. See this question for details.

Community
  • 1
  • 1
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255