A
Aaron Isotton
Hello Group
I am working on a web application involving (mainly) one servlet serving
most of the content. I am using Tomcat 5.5. Specifically, I want to do
the following:
- / (the front page) should be served by MyServlet
- /some-directory/* should be served by MyServlet
- /css/* should be served as static content
(In reality, there are more directories like /css (and more servlets),
but this should be enough to make the point.)
Moreover, it is crucial that there may be only ONE instance of
MyServlet. Thus, using multiple 'servlet' declarations with different
paramenters doesn't work.
If I map / to MyServlet I can't access /css/* any more. So I tried
mapping / to MyServlet and /css/* to 'default' (the Tomcat default
servlet, which serves static content just as I want it to). The problem
is that /css/* is then mapped to the document root; thus I have to use
/css/css/some.file.name to access /css/some.file.name. That's just ugly.
Another way might be mapping only /some-directory/* to MyServlet and
using a forwarding index.jsp in the document root, but that's just plain
ugly.
So my questions are:
- is there some way to specify that /css/* should be served by 'default'
WITHOUT the /css/css uglyness?
- or is there some totally different solution for this problem? I'd like
to keep it as elegant as possible.
Thanks,
Aaron
I am working on a web application involving (mainly) one servlet serving
most of the content. I am using Tomcat 5.5. Specifically, I want to do
the following:
- / (the front page) should be served by MyServlet
- /some-directory/* should be served by MyServlet
- /css/* should be served as static content
(In reality, there are more directories like /css (and more servlets),
but this should be enough to make the point.)
Moreover, it is crucial that there may be only ONE instance of
MyServlet. Thus, using multiple 'servlet' declarations with different
paramenters doesn't work.
If I map / to MyServlet I can't access /css/* any more. So I tried
mapping / to MyServlet and /css/* to 'default' (the Tomcat default
servlet, which serves static content just as I want it to). The problem
is that /css/* is then mapped to the document root; thus I have to use
/css/css/some.file.name to access /css/some.file.name. That's just ugly.
Another way might be mapping only /some-directory/* to MyServlet and
using a forwarding index.jsp in the document root, but that's just plain
ugly.
So my questions are:
- is there some way to specify that /css/* should be served by 'default'
WITHOUT the /css/css uglyness?
- or is there some totally different solution for this problem? I'd like
to keep it as elegant as possible.
Thanks,
Aaron