Reputation: 10606
Let's say I have:
foo.war
bar.war
Is it possible that I deploy them both somehow to the same deployment path? E.g., to access it at:
Are the content of the war files merged somehow? How are file conflicts handled (e.g., let's say both of them has an index.jsp
file)?
Thx in advnace!
Upvotes: 1
Views: 1662
Reputation: 44293
The servlet specification explicitly forbids this. Deployed web applications may not have identical or overlapping context roots. From the Servlet 3.0 specification, section 10.5:
Since the context path of an application determines the URL namespace of the contents of the Web application, Web containers must reject Web applications defining a context path that could cause potential conflicts in this URL namespace. This may occur, for example, by attempting to deploy a second Web application with the same context path.
Upvotes: 3
Reputation: 8446
Yes & no.
I don't think it's possible to somehow merge them into the same file system path within a servlet container like Tomcat (unless you were to write some kind of complicated, intelligent script to do so). For starters, each .war will have a WEB-INF/web.xml
file, and each will rely on the contents of its own file to function -- which would win?
But you conceivably could...
Upvotes: 2