From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> On Fri, 21 Dec 2001, Scott Eade wrote:
> > Subject: servlet-mapping problem - tomcat 4.0.1
> >
> > How do I default a user to my servlet without blocking access
> > to other directories?  Using a default mapping of "/" results in
> > failure to gain access to resources under my servlet directory.
>
> Understanding this requires a little explanation about what is really
> going on.
>
> * The servlet mapping pattern of "/" establishes the
>   default servlet -- in other words, the servlet that
>   Tomcat will hand the request to if it can find no other
>   servlet mapping that matches.
>
> * Tomcat, out of the box, defines a default servlet that
>   serves the static resources (including your stylesheet).
>
> * You can take over the default mapping yourself, but then
>   you give up Tomcat's standard file-serving service and
>   do it yourself if you still need that feature.
>
> To give you suggestions, it would be helpful to understand what you mean
> by "default a user to my servlet".  What application functionality are you
> trying to accomplish?

Thanks Craig.

What I would like to do is be able to serve up some static content
from the root of my web server, say http://mysite.com/ and from there
provide a link to an Apache Turbine application located at
webapps/myapp.  I am simply hoping to provide a relatively
clean url for the application - http://mysite.com/myapp rather than
http://mysite.com/myapp/foo.

I actually have this working at one host provider that uses Zeus
and Resin.  The root directory they provide contains the necessary
resources (styles, templates, etc.) along with the WEB-INF
directory that contains a web.xml with a url-mapping of "/myapp/*"
and everything works fine.

I am switching to a new hosting organization that uses Apache and
Tomcat and I am only now running into this problem.  I thought
the problem was that the new host provider is running tomcat 3.1
(upgrading to 4.01 next week) but then I realised that all of my
development was being done under tomcat with servlet mappings
that included at least some additional component such as
"/myapp/foo/*".

Ultimately I guess I am worried about the aesthetics of the url,
however it would be great if I could somehow mimic the behaviour
of the old site.  What about users that have bookmarked the old
address without the "foo" - I'll have to provide a redirect for them
on top of a redirect that turbine does as a matter of course.  This
will cause some messy behaviour at the beginning of my application.

Incidentally the new hosting organization provides me with my own
virtual tomcat server.  By default they configured a root context
(path="") pointing to a directory called "public_html" and I had
them provide another (path="/myapp"
docBase="/home/myaccount/tomcat/webapps/myapp") where I
am installing my turbine application.  I do have the ability to change
server.xml and restart tomcat if this will help.  I host provider does
need to alter something (mod_jserv or apache I guess) if I add any
new contexts.  It is unclear how this will change when they upgrade
to tomcat 4.01.

I hope this gives you a clearer idea of what I am trying to achieve.

Thanks in advance for any advice.

Scott





--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to