You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by SH Solutions <in...@sh-solutions.de> on 2003/12/02 00:58:51 UTC

Servlet as Welcome File doesn't work

Hello.

I'm using tomcat 4.1.29 on debian and I have the following problem:
I need to get "/" handled by my Servlet "myPackage.Root", but I do not want
to change the mapping of ordinary files.
Just as a welcome file would, but welcome-file does not apply to servlets,
right?

My solutions so far is to map "/" to my servlet an map any other folder with
distinct context's, what surely is'nt what it was meant to be.

I did search the web and the usenet for a long time, since I assumed not to
be the first to run into this problem. But I didn't find anything.
Be aware that I did not enable the jsp-servlet, since I am not using jsps at
all.

If anyone can help me, I would appreciate it very much.

Thanks,

Steffen


PS: No native English speaker here - sorry.


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


Re: Servlet as Welcome File doesn't work

Posted by Rainer Stransky <Ra...@so-fa.de>.
edit the $CATALINA_HOME/ROOT/WEB-INF/web.xml if you want the "root" 
application to show an custom welcome-file

and put 
  <welcome-file-list>
    <welcome-file>myFile.jsp</welcome-file>
  </welcome-file-list>
to the <web-app> tag.


This works on my tomcat 5.0

Rainer
-- 
--------------------------------------------------------------------------
Software Factory GmbH                      mailto:Rainer.Stransky@so-fa.de
Panoramastr. 47, 73084 Salach              phone  : +49 7162 460592
 o technical software development          fax    : +49 7162 460593
 o system engineering                      mobile : +49 172 6714084
 o consulting                              www    : http://www.so-fa.de
--------------------------------------------------------------------------


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


Re: Servlet as Welcome File doesn't work

Posted by bs...@fwdco.com.
That feature has been added in version 5x.
Prior to that you have to map to a static file or a JSP.


On Monday 01 December 2003 06:58 pm, you wrote:
> Hello.
>
> I'm using tomcat 4.1.29 on debian and I have the following problem:
> I need to get "/" handled by my Servlet "myPackage.Root", but I do not want
> to change the mapping of ordinary files.
> Just as a welcome file would, but welcome-file does not apply to servlets,
> right?
>
> My solutions so far is to map "/" to my servlet an map any other folder
> with distinct context's, what surely is'nt what it was meant to be.
>
> I did search the web and the usenet for a long time, since I assumed not to
> be the first to run into this problem. But I didn't find anything.
> Be aware that I did not enable the jsp-servlet, since I am not using jsps
> at all.
>
> If anyone can help me, I would appreciate it very much.
>
> Thanks,
>
> Steffen
>
>
> PS: No native English speaker here - sorry.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

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


AW: Servlet as Welcome File doesn't work

Posted by SH Solutions <in...@sh-solutions.de>.
Hi

I found an solution to force tomcat 4.1.29 to use servlets as welcome files.
My applications web.xml:

<servlet>
	<servlet-name>Root</servlet-name>
	<servlet-class>com.osiris4.servlets.Root</servlet-class>
</servlet>

<servlet-mapping>
	<servlet-name>Root</servlet-name>
	<url-pattern>/root</url-pattern>
</servlet-mapping>

<welcome-file-list>
	<welcome-file>root</welcome-file>
</welcome-file-list>


The problem on this was that tomcat checks for the very existence of the
file "root", before actually invoking the servlet. The trick is to simply
have an empty file "root" in the applications docRoot directory.
If this is a problem for you, simply use another name for that file - e.g.
use the servlets name.

Thanks your answers anyway.

Steffen


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