• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
author & internet detective
Posts: 42055
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic