File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Standard folder location for META-INF in a JEE war application

 
K Mansoor
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always thought (don't know why) that META-INF along with WEB-INF should be at the root of a web app.

+mywebapp
---WEB-INF
------classes
------lib
---META-INF

apparently this is wrong, I found that the JPA persistence.xml should be under META-INF folder which in turn should be on the classpath, so the structure should be:

+mywebapp
---WEB-INF
------classes
---------com/blah
---------META-INF
------------persistence.xml

Don't know why, but for this reason this just don't look right. I searched for a 'standard' META-INF location, but couldn't find an answer, apparently this is an obvious thing except for boneheads like me :-)

Another thing is, (although this may not be the right forum) why Ant <jar> creates META-INF on the root of the war if META-INF is supposed to be on the classpath?

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33691
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The second is correct because META-INF should be in the place as the .class files. To visualize why this makes sense, think of a jar file. It has a META-INF folder in the root and the top level package also in the root. The same goes for the WEB-INF/classes directory. Both are at the same level.

Some IDEs show the META-INF higher up because they put it with the source code. It still jars up into the standard format though.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic