You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gautam Gothoskar <ma...@yahoo.com> on 2005/11/30 21:15:08 UTC

Deploying in ROOT folder using a war file

Hi!
  I have the following issue:
  I have a war file (myapp.war) which when deployed in
tomcat is accessible by using the url
http://localhost:8080/myapp. Tomcat creates a folder
called 'myapp' in the webapps directory. But I need to
configure the app in such a way that the the app is
accessible without any context path
(http://localhost:8080). This is possible if I copy
the expanded files from myapp folder into the ROOT
folder. But how do I tell tomcat to extract the files
into the ROOT folder instead of creating a 'myapp'
folder for deployment?
   I tried using myapp.xml file in the webapps folder
and adding the following content to it:
   <Context path="" docBase="myapp.war" debug="0">
   </Context>
   What this does is it creates the myapp folder but
the application is accessible using both urls:
http://localhost:8080/myapp as well as
http://localhost:8080/. I also see that 2 servlet
instances are loaded in memory.

   Any help will be appreciated.

 Thanks,
 Gautam.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying in ROOT folder using a war file

Posted by Vivek Mohan <vi...@gmail.com>.
Tomcat is extracting the files to localhost/_ because thats where it
knows it has to extract anything from the ROOT application.

--
Vivek.

On 12/1/05, Gautam Gothoskar <ma...@yahoo.com> wrote:
> Mark,
>   I have deleted the ROOT folder from the webapps
> directory. I have the unpackWARs set to true in the
> host element in server.xml. My tomcat version is
> 4.1.24.
>   What tomcat does is it loads up the servlet on
> startup as I have specified it in web.xml. It extracts
> the WEB-INF/classes and lib folder required for the
> servlet in TOMCAT_HOME/work/Standalone/localhost/_
> directory. It extracts the jsps and other files as and
> when required. But the problem is with stylesheets and
> javascript files. These files are not explicitly
> called and hence never get extracted. So the jsp does
> not find those files.
>   I also have no ides why tomcat is extracting the
> files to TOMCAT_HOME/work/Standalone/localhost/_ .
>
> Thanks,
> Gautam.
>
>
>
> --- Mark Thomas <ma...@apache.org> wrote:
>
> > Gautam Gothoskar wrote:
> > > Hi Mark,
> > >   Thanks for the quick reply. But in doing the way
> > you
> > > have mentioned, tomcat does NOT expand the classes
> > etc
> > > in the ROOT folder. The application does get
> > loaded
> > > and work. I was wondering if there is any way that
> > the
> > > war file could be expanded in the ROOT folder?
> > >
> > > regards,
> > > Gautam.
> >
> > Any existing ROOT folder has to be deleted before
> > any new ROOT.war is
> > expanded. This assumes, of course, that you have set
> > unpackWARs=true
> >
> > Mark
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail:
> > users-help@tomcat.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying in ROOT folder using a war file

Posted by Gautam Gothoskar <ma...@yahoo.com>.
Mark,
  I have deleted the ROOT folder from the webapps
directory. I have the unpackWARs set to true in the
host element in server.xml. My tomcat version is
4.1.24.
  What tomcat does is it loads up the servlet on
startup as I have specified it in web.xml. It extracts
the WEB-INF/classes and lib folder required for the
servlet in TOMCAT_HOME/work/Standalone/localhost/_
directory. It extracts the jsps and other files as and
when required. But the problem is with stylesheets and
javascript files. These files are not explicitly
called and hence never get extracted. So the jsp does
not find those files. 
  I also have no ides why tomcat is extracting the
files to TOMCAT_HOME/work/Standalone/localhost/_ .

Thanks,
Gautam.



--- Mark Thomas <ma...@apache.org> wrote:

> Gautam Gothoskar wrote:
> > Hi Mark,
> >   Thanks for the quick reply. But in doing the way
> you
> > have mentioned, tomcat does NOT expand the classes
> etc
> > in the ROOT folder. The application does get
> loaded
> > and work. I was wondering if there is any way that
> the
> > war file could be expanded in the ROOT folder?
> > 
> > regards,
> > Gautam.
> 
> Any existing ROOT folder has to be deleted before
> any new ROOT.war is 
> expanded. This assumes, of course, that you have set
> unpackWARs=true
> 
> Mark
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying in ROOT folder using a war file

Posted by Mark Thomas <ma...@apache.org>.
Gautam Gothoskar wrote:
> Hi Mark,
>   Thanks for the quick reply. But in doing the way you
> have mentioned, tomcat does NOT expand the classes etc
> in the ROOT folder. The application does get loaded
> and work. I was wondering if there is any way that the
> war file could be expanded in the ROOT folder?
> 
> regards,
> Gautam.

Any existing ROOT folder has to be deleted before any new ROOT.war is 
expanded. This assumes, of course, that you have set unpackWARs=true

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying in ROOT folder using a war file

Posted by Gautam Gothoskar <ma...@yahoo.com>.
Hi Mark,
  Thanks for the quick reply. But in doing the way you
have mentioned, tomcat does NOT expand the classes etc
in the ROOT folder. The application does get loaded
and work. I was wondering if there is any way that the
war file could be expanded in the ROOT folder?

regards,
Gautam.

--- Mark Thomas <ma...@apache.org> wrote:

> Gautam Gothoskar wrote:
> 
> Options:
> - Name your web-app ROOT.war
> - Put your web-app outside the appbase and place a
> ROOT.xml in the appbase
> 
> Mark
> 
> > Hi!
> >   I have the following issue:
> >   I have a war file (myapp.war) which when
> deployed in
> > tomcat is accessible by using the url
> > http://localhost:8080/myapp. Tomcat creates a
> folder
> > called 'myapp' in the webapps directory. But I
> need to
> > configure the app in such a way that the the app
> is
> > accessible without any context path
> > (http://localhost:8080). This is possible if I
> copy
> > the expanded files from myapp folder into the ROOT
> > folder. But how do I tell tomcat to extract the
> files
> > into the ROOT folder instead of creating a 'myapp'
> > folder for deployment?
> >    I tried using myapp.xml file in the webapps
> folder
> > and adding the following content to it:
> >    <Context path="" docBase="myapp.war" debug="0">
> >    </Context>
> >    What this does is it creates the myapp folder
> but
> > the application is accessible using both urls:
> > http://localhost:8080/myapp as well as
> > http://localhost:8080/. I also see that 2 servlet
> > instances are loaded in memory.
> > 
> >    Any help will be appreciated.
> > 
> >  Thanks,
> >  Gautam.
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail:
> users-help@tomcat.apache.org
> > 
> > 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Deploying in ROOT folder using a war file

Posted by Mark Thomas <ma...@apache.org>.
Gautam Gothoskar wrote:

Options:
- Name your web-app ROOT.war
- Put your web-app outside the appbase and place a ROOT.xml in the appbase

Mark

> Hi!
>   I have the following issue:
>   I have a war file (myapp.war) which when deployed in
> tomcat is accessible by using the url
> http://localhost:8080/myapp. Tomcat creates a folder
> called 'myapp' in the webapps directory. But I need to
> configure the app in such a way that the the app is
> accessible without any context path
> (http://localhost:8080). This is possible if I copy
> the expanded files from myapp folder into the ROOT
> folder. But how do I tell tomcat to extract the files
> into the ROOT folder instead of creating a 'myapp'
> folder for deployment?
>    I tried using myapp.xml file in the webapps folder
> and adding the following content to it:
>    <Context path="" docBase="myapp.war" debug="0">
>    </Context>
>    What this does is it creates the myapp folder but
> the application is accessible using both urls:
> http://localhost:8080/myapp as well as
> http://localhost:8080/. I also see that 2 servlet
> instances are loaded in memory.
> 
>    Any help will be appreciated.
> 
>  Thanks,
>  Gautam.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org