tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: Servlet mappings?
Date Thu, 04 Sep 2003 05:26:16 GMT

<JStanczak@vinu.edu> wrote in message
news:OFA583E3B9.021464C3-ON05256D97.0018379E-05256D97.00184DBF@vinu.edu...
> Seems strange that there wouldn't be the option to do this. Is there any
> way to write your own default servlet?
>

To do your own default servlet, you need a mapping like the one for
"default" in conf/web.xml:
   <servlet-mapping>
      <servlet-name>MyDefaultServlet</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>

This mapping sends anything that doesn't match any other mapping to
MyDefaultServlet.  In particular, this usually means static content as well
(e.g. gif, jpeg, css, etc files), so your servlet has to be prepared to deal
with this case as well.


>
> Thank You,
>
> Justin A. Stanczak
> Web Manager
> Shake Learning Resource Center
> Vincennes University
> (812)888-5813
>
>
>
>
> "Mike Cherichetti \(Renegade Internet\)" <mike@renegadeinternet.com>
> 09/03/2003 08:11 PM
> Please respond to "Tomcat Users List"
>
>
>         To:     "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>         cc:
>         Subject:        RE: Servlet mappings?
>
>
> I don't think this can be done with mappings.  You can put an index.jsp
> file
> with only a forward/redirect call in it to transfer control to your
> servlet.
> I've done this before, seems to work quite well.
>
> Mike
>
> -----Original Message-----
> From: JStanczak@vinu.edu [mailto:JStanczak@vinu.edu]
> Sent: Wednesday, September 03, 2003 8:55 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Servlet mappings?
>
>
> I have a web app with multiple servlets. I would like one of those
> servlets to handle all requests to http://mywebserver/. Basically I want
> it to do the same thing as the welcome-file in the web.xml. How can I do
> this?
>
>
> Thank You,
>
> Justin A. Stanczak
> Web Manager
> Shake Learning Resource Center
> Vincennes University
> (812)888-5813
>
>
>
>
> ---------------------------------------------------------------------
> 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