tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milt Epstein <mepst...@uiuc.edu>
Subject RE: Multiple Paths in one Context
Date Thu, 29 Apr 2004 16:55:18 GMT
On Thu, 29 Apr 2004, Ben Janes wrote:

> HI,
>
> This is what I need
> <!-- SNIP --->
>
> For example, do your paths all need to have just one level of
> directories on them, or could you use a set like:
>
> www.xyz.com/myapp/mypath1
> www.xyz.com/myapp/mypath2
> www.xyz.com/myapp/mypath3
> www.xyz.com/myapp/mypath4
>
> If so, then maybe you could get by with one context (myapp), and use
> servlet definitions and servlet mappings to get things to work the way
> you want.
>
> <!-- END SNIP --->
>
> however I have lots of JSPs etc... so I am not sure how to 'define'
> those so to speak.... in fact the only servlets are initialisation
> servlets... fired at the boot of the web app

Servlet definitions and servlet mappings are basic functions of the
web.xml configuration file, so you should probably read up on it.  JSP
files can be "defined" the same way servlets can, just use jsp-file
instead of servlet-class (IIRC).

Normally you wouldn't have to define/map JSP files, but if you're
using artificial paths such as the above, then you will need to.  That
is, if you have a JSP foo.jsp in your myapp context/directory,
normally you'd access it via:

www.xyz.com/myapp/foo.jsp

But if you want it to work via all of:

www.xyz.com/myapp/mypath1/foo.jsp
www.xyz.com/myapp/mypath2/foo.jsp
www.xyz.com/myapp/mypath3/foo.jsp
www.xyz.com/myapp/mypath4/foo.jsp

then you have to define it and map to it.  This could get burdensome
if you have a lot of these fake paths and a lot of JSPs.  I'm not that
familiar with wildcarding in servlet-mappings, but maybe you can use
that to ease this burden, for example, using a url-pattern like
"/*/foo.jsp" to catch them all.

(And note that this overall approach may not be the only way to do
what you want, it's just something I thought of that looked like it
fit your situation.)


> On Tue, 20 Apr 2004, Ben Janes wrote:
>
> > HI,
> >
> > This isn't really what I wanted.
> >
> > I need one context, that is accessible from several paths...
> >
> > so that
> >
> > www.xyz.com/mypath1
> > www.xyz.com/mypath2
> > www.xyz.com/mypath3
> > www.xyz.com/mypath4
> >
> > All go to the same directory.... whilst maintaining there uniqueness
> > of path names
> [ ... ]
>
> Maybe it would be more helpful if you say in some detail what you want
> to do and why, and then people will be able to give you better suggestions.
>
> For example, do your paths all need to have just one level of
> directories on them, or could you use a set like:
>
> www.xyz.com/myapp/mypath1
> www.xyz.com/myapp/mypath2
> www.xyz.com/myapp/mypath3
> www.xyz.com/myapp/mypath4
>
> If so, then maybe you could get by with one context (myapp), and use
> servlet definitions and servlet mappings to get things to work the way
> you want.
>
> Or, have you tried having multiple Context tags, all with different
> paths but the same docBase?  I don't know if that's allowed, or if
> it's been suggested, but maybe it's worth looking into.
>
> Milt Epstein
> Research Programmer
> Integration and Software Engineering (ISE)
> Campus Information Technologies and Educational Services (CITES)
> University of Illinois at Urbana-Champaign (UIUC)
> mepstein@uiuc.edu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu

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


Mime
View raw message