tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JStanc...@vinu.edu
Subject Re: How do I set a default servlet?
Date Mon, 10 Feb 2003 16:39:32 GMT

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?


Thank You,

Justin A. Stanczak
Web Manager
Shake Learning Resource Center
Vincennes University
(812)888-5813


|---------+---------------------------->
|         |           "Bill Barker"    |
|         |           <wbarker@wilshire|
|         |           .com>            |
|         |           Sent by: news    |
|         |           <news@main.gmane.|
|         |           org>             |
|         |                            |
|         |                            |
|         |           01/10/03 02:26 AM|
|         |           Please respond to|
|         |           "Tomcat Users    |
|         |           List"            |
|         |                            |
|---------+---------------------------->
  >--------------------------------------------------------------------------------------------------------------|
  |                                                                                      
                       |
  |       To:       tomcat-user@jakarta.apache.org                                       
                       |
  |       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.
<JStanczak@vinu.edu> wrote in message
news:OF82399492.7D89FAD8-ON05256CA9.005A5EB4@vinu.edu...
> 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:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@jakarta.apache.org>







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


Mime
View raw message