<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Is that the only bad thing about it. The reason I'm asking is because the
> servlet that I'm wanting to map is the one that generates all the web
> pages. So if someone goes to http://www.myserver.com I want that to call
> this servlet that will generate a default web page. Namely the front page
> to our web site. But if someone types
> http://www.myserver.com/servlet/pageservlet it also takes them to this
> servlet that's also the default. Then I don't want it to interfere with
> other mappings like manager and any other servlets that I create. I don't
> really mind if it defaults all unknown request to the default that is a
> servlet. Also, the mapping you show, is that in the web app or in the
> /conf/web.xml for the server?

It's in the web app.  The "default" servlet has a similar mapping in
conf/web.xml.

It looks like you really do want a default servlet (in the sense of the
Servlet-Spec).  This mapping is a bit special.  The container uses it only
after all other servlet-mappings have failed.  This means that it won't
interfere with any other servlet-mappings that you have.  You can even use
this fact to get out of handling images your self by adding mappings like:
<servlet-mapping>
   <servlet-name>default</servlet-name>
   <url-pattern>*.gif</url-pattern>
</servlet-mapping>

>
>
> Thank You,
>
> Justin A. Stanczak
> Web Manager
> Shake Learning Resource Center
> Vincennes University
> (812)888-5813
>
>
> |---------+---------------------------->
> |         |           "Bill Barker"    |
> |         |           <wbarker@wilshire|
> |         |           .com>            |
> |         |           Sent by: news    |
> |         |           <[EMAIL PROTECTED]|
> |         |           org>             |
> |         |                            |
> |         |                            |
> |         |           01/10/03 02:26 AM|
> |         |           Please respond to|
> |         |           "Tomcat Users    |
> |         |           List"            |
> |         |                            |
> |---------+---------------------------->
>
>---------------------------------------------------------------------------
-----------------------------------|
>   |
|
>   |       To:       [EMAIL PROTECTED]
|
>   |       cc:
|
>   |       Subject:  Re: How do I set a default servlet?
|
>
>---------------------------------------------------------------------------
-----------------------------------|
>
>
>
>
> Setting the default servlet is really easy.  You just specify:
> <servlet>
>   <servlet-name>myservlet</servlet-name>
>   <servlet-class>myservlet</servlet-class>
> </servlet>
> <servlet-mapping>
>   <servlet-name>myservlet</servlet-name>
>   <url-pattern>/</url-pattern>
> </servlet-mapping>
>
> The problem is that this is almost certainly not what you want.  This will
> invoke 'myservlet' for any URL that doesn't match any other
servlet-mapping
> (including static-content).
>
> It looks like you want to have your welcome-file specified as a Servlet.
> This is only currently supported in Tomcat 3.3.2-dev (aka nightly), and
> Tomcat 5.x.
> <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I would like to setup my servlet server to point anyone that accesses
the
> > default url to be sent to a certain servlet. For example if someone
typed
> > http://localhost/ then it would take them right to
> > http://localhost/servlet/myservlet . I'm guessing this is done through
> the
> > web.xml in the conf directory, but is there a better way, like in the
> > applications web.xml. Either way hows the best way to accomplish this?
> > Thanks.
> >
> >
> > Thank You,
> >
> > Justin A. Stanczak
> > Web Manager
> > Shake Learning Resource Center
> > Vincennes University
> > (812)888-5813
>
>
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to