You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Douglas L Stewart <do...@pobox.com> on 2002/09/24 16:56:49 UTC

using servlet as index documentation

I saw that you cannot add a servlet as a welcome-file.  I've seen
suggestions to use an HTML page or a JSP to redirect to a servlet
(doing this currently), but is it possible to use a servlet to be your
opening page?

I tried using / as url-pattern, but it would redirect all URL's to the
servlet.  I tried ^/$ and that didn't work either.

Any ideas?

---
Douglas L Stewart
douglas@pobox.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: using servlet as index documentation

Posted by Jacob Kjome <ho...@visi.com>.
Hello Douglas,

Well, you should be able to provide a servlet-mapping.

Try this....

<servlet>
        <servlet-name>MyIndexPage</servlet-name>
        <servlet-class>com.mycompany.MyDefaultServlet</servlet-class>
</servlet>
<servlet-mapping>
        <servlet-name>MyIndexPage</servlet-name>
        <url-pattern>/index.html</url-pattern>
</servlet-mapping>

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
</welcome-file-list>


Jake


Tuesday, September 24, 2002, 9:56:49 AM, you wrote:

DLS> I saw that you cannot add a servlet as a welcome-file.  I've seen
DLS> suggestions to use an HTML page or a JSP to redirect to a servlet
DLS> (doing this currently), but is it possible to use a servlet to be your
DLS> opening page?

DLS> I tried using / as url-pattern, but it would redirect all URL's to the
DLS> servlet.  I tried ^/$ and that didn't work either.

DLS> Any ideas?

DLS> ---
DLS> Douglas L Stewart
DLS> douglas@pobox.com

DLS> --
DLS> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
DLS> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>