You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ja...@carat.dk on 2001/11/07 17:48:48 UTC

Different behavior when forwarding to *.jsp and *.html in WEB-INF

In the attached webapp, outlined in diagram below i see some rather
strange behavior (result of my feeble attempt to isolate the problem).

http://localhost:8080/example/redirectOK.jsp returns ok.jsp

http://localhost:8080/example/redirectBAD.jsp returns empty document

I would have expected both requests to behave in a similar manner
is this a bug or is there a reason why outcome differs ?

/ -+- redirectOK.jsp
   |    <%pageContext.forward("WEB-INF/jsp/ok.jsp");%>
   |
   +- redirectBAD.jsp
   |    <%pageContext.forward("WEB-INF/jsp/bad.html");%>
   |
   +- WEB-INF -+- web.xml
               | <web-app>
               | </web-app>
               |
               +- jsp -+- ok.jsp
                       | <HTML>
                       |  <BODY>
                       |   <H1>ok.jsp</H1>
                       |  </BODY>
                       | </HTML>
                       |
                       +- bad.html
                         <HTML>
                          <BODY>
                           <H1>bad.html</H1>
                          </BODY>
                         </HTML>

Re: Different behavior when forwarding to *.jsp and *.html in WEB-INF

Posted by Alexis LESAGE <al...@atosorigin.com>.
one is .jsp and other .html
Shouldn't the .html ressources be at the same lvl than WEB-INF files
Check the .war directory structures.

Al
----- Original Message -----
From: <Ja...@carat.dk>
To: <to...@jakarta.apache.org>
Sent: Wednesday, November 07, 2001 5:48 PM
Subject: Different behavior when forwarding to *.jsp and *.html in WEB-INF


> In the attached webapp, outlined in diagram below i see some rather
> strange behavior (result of my feeble attempt to isolate the problem).
>
> http://localhost:8080/example/redirectOK.jsp returns ok.jsp
>
> http://localhost:8080/example/redirectBAD.jsp returns empty document
>
> I would have expected both requests to behave in a similar manner
> is this a bug or is there a reason why outcome differs ?
>
> / -+- redirectOK.jsp
>    |    <%pageContext.forward("WEB-INF/jsp/ok.jsp");%>
>    |
>    +- redirectBAD.jsp
>    |    <%pageContext.forward("WEB-INF/jsp/bad.html");%>
>    |
>    +- WEB-INF -+- web.xml
>                | <web-app>
>                | </web-app>
>                |
>                +- jsp -+- ok.jsp
>                        | <HTML>
>                        |  <BODY>
>                        |   <H1>ok.jsp</H1>
>                        |  </BODY>
>                        | </HTML>
>                        |
>                        +- bad.html
>                          <HTML>
>                           <BODY>
>                            <H1>bad.html</H1>
>                           </BODY>
>                          </HTML>
>
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Different behavior when forwarding to *.jsp and *.html in WEB-INF

Posted by Steve Guo <j2...@yahoo.com>.
Both behave similarly on my Win NT with Tomcat4.0. I
am not sure what the difference is on your machine.

Remember, for getEuqestDispatcher() and forward(), the
base folder is your application folder, say, your app
folder is webapps/myapp, and your forward file is in
webapps/myapp/jsp/bad.html
then the syntaxt is
<%pageContext.forward("/jsp/bad.html");%>

Good luck



--- Jan.Hansen@carat.dk wrote:
> In the attached webapp, outlined in diagram below i
> see some rather
> strange behavior (result of my feeble attempt to
> isolate the problem).
> 
> http://localhost:8080/example/redirectOK.jsp returns
> ok.jsp
> 
> http://localhost:8080/example/redirectBAD.jsp
> returns empty document
> 
> I would have expected both requests to behave in a
> similar manner
> is this a bug or is there a reason why outcome
> differs ?
> 
> / -+- redirectOK.jsp
>    |   
> <%pageContext.forward("WEB-INF/jsp/ok.jsp");%>
>    |
>    +- redirectBAD.jsp
>    |   
> <%pageContext.forward("WEB-INF/jsp/bad.html");%>
>    |
>    +- WEB-INF -+- web.xml
>                | <web-app>
>                | </web-app>
>                |
>                +- jsp -+- ok.jsp
>                        | <HTML>
>                        |  <BODY>
>                        |   <H1>ok.jsp</H1>
>                        |  </BODY>
>                        | </HTML>
>                        |
>                        +- bad.html
>                          <HTML>
>                           <BODY>
>                            <H1>bad.html</H1>
>                           </BODY>
>                          </HTML>

> ATTACHMENT part 2 application/octet-stream
name=badexample.war
> --
> To unsubscribe:  
> <ma...@jakarta.apache.org>
> For additional commands:
> <ma...@jakarta.apache.org>
> Troubles with the list:
<ma...@jakarta.apache.org>


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>