The best solution is not using a warfile.
Copy all the content into a specified directory (i.e. \user\abc
) and then you can either configure all the contexts in two ways.
one xml for every context to map, by putting it into your: %CATALINA_HOME%\conf\Catalina\localhost
. Keep in mind that the name of the xml file will be the mapping of your webapp, but you can redefine it with the path
attribute inside the xml. In your case you have to produce abc.xml
, abc1.xml
, abc2.xml
and their content should be something like:
abc.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="\user\abc" path="abc" reloadable="false"/>
abc1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="\user\abc" path="abc1" reloadable="false"/>
you can edit directly the %CATALINA_HOME%\conf\server.xml
by inserting, inside the <Host ...>
tag, the contexts definitions, something like this:
<Host ...>
<Context docBase="\user\abc" path="abc" reloadable="false"/>
<Context docBase="\user\abc" path="abc1" reloadable="false"/>
</Host>
If you need to provide database datasource information to a context, just add the tag Resource to the context definition itself (either in an xml file or in server.xml),here you go with a sample:
<Context docBase="\user\abc" path="abc" reloadable="false">
<Resource auth="Container" description="DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="4"
maxIdle="2"
maxWait="5000"
name="jdbc/myJNDIname"
password="mypass"
type="javax.sql.DataSource"
url="jdbc:oracle:thin:@host:port:SID"
username="myuser"/>
</Context>
If you need this last part, just use it, obviously, for every context you like to duplicate.
Hope it helps.