On Fri, Jan 25, 2013 at 3:29 AM, Konstantin Kolinko
<knst.koli...@gmail.com>wrote:

> 2013/1/25 bxqdev <bxq...@themailbay.com>:
> >>
> >> Anyway I would say a context.xml file in conf/catalina/path1 (the
> >> hostname)/path1.xml (the context name) should do the trick?
> >> Place the webapp outside the appbase of the hosts and then point the
> >> docbase to the webapp (or just drop the .war with two
> >> different names in the appbases of the two hosts) :)
> >
>

When we do this method, a separate web-application is spawned for each
context.  The common web-application and also all it's jars are not
shared.  You would need to adjust PermGen - basically hike it up
appropriately.  We have a similar situation.  We used this approach of
putting webapp outside appbase and pointing docbase to it for each context
within individual context.xml files.  The reason we did this was because we
have another default webapp serving as the root context.  This is a
solution we would like to avoid.

I would like to seek advice on how we might use a non-default webapp
serving multiple contexts, but yet have a single copy of the application's
classes and it's libraries being loaded into PermGen.


> >
> > i want to have one instance of webapp,
> > which has two paths,
> > and each of the paths serves the root of different domains
> >
> > once again:
> > * one webapp
> > * has 2 different paths: "/path1" and "/path2"
> > * served on 2 domains
> > * when user goes to http://path1.com/ -> {webapp}/path1 is served as
> root
> > path
> > * when user goes to http://path2.com/ -> {webapp}/path2 is served as
> root
> > path
> >
> > is it possible?
> >
>
> Two different instances of the same webapp at different hosts - easy.
> E.g. the manager webapp is deployed in such way to the virtual hosts.
>
>
Sorry, I'm not understanding what you propose.  Would this method also
share the application and all classes among the different contexts?

One instance mapped to different paths - impossible. What value should
> be returned by javax.servlet.ServletContext.getContextPath() ?
>



> Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.
>
>
I have wanted to try this way out but haven't gotten around to it.  I
believe this method would share a single copy of the non-default web
application, am I correct?

Thanks!

                       -Shanti

Reply via email to