Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deploying using war file using in other folders

 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tested war file it deploys application fine under webapp. But we have directories like webapp/retail, webapp/sales etc. Each of these folders hold their own application war files and jsp etc. Can tomcat unpack a file if I put it in retail folder say retail.war. I tried that and it did not work. We are limited to copy our files (including wars's in subfolders of webapp). How do we do that? Seems for tomcat to do automatic deployment the war file needs to be put under webapp only?
 
Shankar Narayana
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you are creating the war files, include the sales folder also and deploy it in webapp folder.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have this directory structure?

So, Tomcat will not recursively search directories under webapps. It searches for *.war only in the webapps directory, not subdirectories.

So if retail.war and sales.war are two individual applications, then you should have:

And when it gets deployed, those will each expode into a directory named with the war file's name.

If , on the other hand, you have a single directory called "webapp" (note the lack of 's'), and this 'webapp' is a single application, with "subapplications" called retail and sales... then this is not at all how web-apps are to be constructed and deployed. That just won't work.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic