Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

alias servlet such that only server name is required in Tomcat

1 view
Skip to first unread message

Tomcat

unread,
Feb 28, 2001, 8:29:45 PM2/28/01
to
Hi,

I am using Tomcat 3.1 and I need to shorten URL such that if I type in
http://servername:port/, it will get to the login servlet page. Basically, I
have a servlet like com.abc.login and I was able to alias it to
http://servername:port/login but I can't figure out a way to alias it
further such that even "login" following the servername is not necessary.
The way I mapped the login servlet is by adding the following to web.xml,

<servlet>
<servlet-name>
sl
</servlet-name>
<servlet-class>
com.abc.login
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
sl
</servlet-name>
<url-pattern>
/login
</url-pattern>
</servlet-mapping>

Does anyone know how to fix it so all I need is http://servername:port/?

Thank you!


Jon Skeet

unread,
Mar 1, 2001, 1:57:27 AM3/1/01
to
Tomcat <p...@tomcat.com> wrote:
> I am using Tomcat 3.1 and I need to shorten URL such that if I type in
> http://servername:port/, it will get to the login servlet page. Basically, I
> have a servlet like com.abc.login and I was able to alias it to
> http://servername:port/login but I can't figure out a way to alias it
> further such that even "login" following the servername is not necessary.
> The way I mapped the login servlet is by adding the following to web.xml,

You need to make your servlet one of the welcome pages. Have a look at
the welcome-file-list (or something similar) attribute in web.xml.

--
Jon Skeet - sk...@pobox.com
http://www.pobox.com/~skeet

Simon Brooke

unread,
Mar 1, 2001, 7:09:52 AM3/1/01
to
on Thursday 01 March 2001 01:29, Tomcat wrote:

> Hi,
>
> I am using Tomcat 3.1 and I need to shorten URL such that if I type in
> http://servername:port/, it will get to the login servlet page.
> Basically, I have a servlet like com.abc.login and I was able to alias
> it to http://servername:port/login but I can't figure out a way to
> alias it further such that even "login" following the servername is
> not necessary. The way I mapped the login servlet is by adding the
> following to web.xml,

Are you using Tomcat with Apache, or standalone? If with Apache, look
up the documentation for mod_rewrite - it will solve your problem.

--
si...@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

to err is human, to lisp divine
;; attributed to Kim Philby, oddly enough.

0 new messages