You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Ramsey <da...@yahoo.com> on 2003/12/19 19:48:25 UTC

Welcome File Oddities in Tomcat 5.0.16

In a webapp on which I work, we could specify a welcome file with the
following syntax:

    <welcome-file-list>
        <welcome-file>
            jsp/myLogin.jsp
        </welcome-file>
    </welcome-file-list>

This worked in Tomcat 4.x without problems. I yesterday installed
Tomcat 5.0.16 and am unable to get this to work any longer. Reviewing
the 2.4 servlet specification, particularly SRV.9.10 which covers
welcome files, I see nothing indicating any changes in behavior.

What I am seeing Tomcat 5.0.16 do though is treat the jsp as if it were
running at either web application root or servlet container root. I'm
not completely sure which yet. This occurs now with partial URIs that
worked under Tomcat 4.x. 
For example: htpp://myserver.mydomain.com:8080/myapplication
The above partial URI used to map correctly to:
htpp://myserver.mydomain.com:8080/myapplication/jsp/myLogin.jsp

Under Tomcat 4.x I could do this and the JSP would be treated as though
it were running in the /jsp folder and if I referenced an image such as
../images/myloginimage.jpg this would display correctly. Or if I
referenced another jsp to forward to such as ../jsp/myHompage.jsp or
similar.

Under Tomcat 5.0.16, I do get the login page but no images are
correctly referenced and forwarding does not seem to occur correctly.

Note however that if I specify the full URI to login:
htpp://myserver.mydomain.com:8080/myapplication/jsp/myLogin.jsp
that then everything will work correctly.

If there was a change to this behavior then I have not found the
documentation for that change in the new spec. If this is a bug, I've
not found anything related to it in the current bug reports for Tomcat
5.

Thanks in advance for any feedback. This one just seems odd.

Dave Ramsey


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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


Re: Welcome File Oddities in Tomcat 5.0.16

Posted by Tim Funk <fu...@joedog.org>.
4.1 did redirects for welcome files, 5 does forwards.

So in 4.1, asking for
http://myserver.mydomain.com:8080/myapplication/
would issue a redirect to
http://myserver.mydomain.com:8080/myapplication/jsp/myLogin.jsp

But in 5.0:
http://myserver.mydomain.com:8080/myapplication/
is servered directly by an internal forwards so the browser sees as the URL
http://myserver.mydomain.com:8080/myapplication/

It is generally a bad idea to have a / in a welcome file.

-Tim

David Ramsey wrote:

> In a webapp on which I work, we could specify a welcome file with the
> following syntax:
> 
>     <welcome-file-list>
>         <welcome-file>
>             jsp/myLogin.jsp
>         </welcome-file>
>     </welcome-file-list>
> 
> This worked in Tomcat 4.x without problems. I yesterday installed
> Tomcat 5.0.16 and am unable to get this to work any longer. Reviewing
> the 2.4 servlet specification, particularly SRV.9.10 which covers
> welcome files, I see nothing indicating any changes in behavior.
> 
> What I am seeing Tomcat 5.0.16 do though is treat the jsp as if it were
> running at either web application root or servlet container root. I'm
> not completely sure which yet. This occurs now with partial URIs that
> worked under Tomcat 4.x. 
> For example: htpp://myserver.mydomain.com:8080/myapplication
> The above partial URI used to map correctly to:
> htpp://myserver.mydomain.com:8080/myapplication/jsp/myLogin.jsp
> 
> Under Tomcat 4.x I could do this and the JSP would be treated as though
> it were running in the /jsp folder and if I referenced an image such as
> ../images/myloginimage.jpg this would display correctly. Or if I
> referenced another jsp to forward to such as ../jsp/myHompage.jsp or
> similar.
> 
> Under Tomcat 5.0.16, I do get the login page but no images are
> correctly referenced and forwarding does not seem to occur correctly.
> 
> Note however that if I specify the full URI to login:
> htpp://myserver.mydomain.com:8080/myapplication/jsp/myLogin.jsp
> that then everything will work correctly.
> 
> If there was a change to this behavior then I have not found the
> documentation for that change in the new spec. If this is a bug, I've
> not found anything related to it in the current bug reports for Tomcat
> 5.
> 
> Thanks in advance for any feedback. This one just seems odd.
> 
> Dave Ramsey
> 
> 
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
> 
> ---------------------------------------------------------------------
> 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