• Post Reply Bookmark Topic Watch Topic
  • New Topic

J2EE war structure  RSS feed

 
Johnny Gara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been at a few jobs, and it's always seem to vary a bit. Is there a standard ("official") way to deploy applications in a war file?

src/
src/com/
src/com/(rest of your .class files)

WEB-INF/
WEB-INF/web.xml
WEB-INF/lib
WEB-INF/lib/(all your jar's here)
WEB-INF/classes
WEB-INF/classes/com/(all your property files here)

test/
test/com/(testing classes)

jsp/
jsp/(all your jsp's here) <---- I've seen all the jsp's in the root path as well

img/ <-- images
js/ <-- javascript
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aside from WEB-INF and its sub-folders, the structure is up to you.

Why are you putting source files in the war?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few other notes:

WEB-INF/classes/com/(all your property files here)

Property files can go anywhere in the classpath that makes sense. What if there's no com package?

jsp/(all your jsp's here) <---- I've seen all the jsp's in the root path as well

All my JSPs go in a folder hierarchy under WEB-INF so that they cannot be directly accessed.
 
Johnny Gara
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Aside from WEB-INF and its sub-folders, the structure is up to you.

Why are you putting source files in the war?


Lol, sorry, posted that late in the day, brain wasn't working.

I was actually thinking of the actual project build directory. So you'd have your source and test files in there as well ;)

in your actual war file, I'd assume you'd only want

js/ <-javascripts
imgs/ <-images
WEB-INF/ <- config files
WEB-INF/lib <- libraries
WEB-INF/jsp <- jsp files (thanks for the tip!)
WEB-INF/classes/com/...etc

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!