You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Glen Mazza <gr...@verizon.net> on 2005/08/22 21:39:57 UTC
(ultra-newbie) Cannot forward to a JSP within WEB-INF
Hello,
I'm trying unsuccessfully, within an action-mapping, to forward to a
UserQuery.JSP kept within the WEB-INF/pages folder of the web
application. (I'm intentionally placing it there to prevent direct
access of this jsp from the browser.)
I'm getting a Tomcat 5.0.28 error as follows:
"The requested resource (/myapp/WEB-INF/pages/UserQuery.jsp) is not
available."
(I've confirmed that the file is there.) My action mapping is as follows:
<action
path="/login"
input="/WEB-INF/pages/LoginForm.jsp"
name="loginForm"
type="com.xxxxx.myapp.struts.action.LoginAction"
scope="request"
validate="true">
<forward name="Failure" path="/WEB-INF/pages/LoginForm.jsp"
redirect="true"/>
<forward name="Success" path="/WEB-INF/pages/UserQuery.jsp"
redirect="true"/>
</action>
I'm sure I'm making an obvious mistake here. Any enlightenment would be
much appreciated.
Thanks,
Glen
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: (ultra-newbie) Cannot forward to a JSP within WEB-INF
Posted by Glen Mazza <gr...@verizon.net>.
That was it--just switch redirect to "false" in order to forward
instead. Thanks Craig!
Glen
Craig McClanahan wrote:
> On 8/22/05, Glen Mazza <gr...@verizon.net> wrote:
>
>
>> <forward name="Failure" path="/WEB-INF/pages/LoginForm.jsp"
>>redirect="true"/>
>> <forward name="Success" path="/WEB-INF/pages/UserQuery.jsp"
>>redirect="true"/>
>
>
> You are using redirects here, which causes the browser to make a
> second request to the new URL. It's not legal to make a request
> directly to a JSP page (or any other resource) inside the /WEB-INF
> directory; you have to use forwards instead.
>
> Craig
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: (ultra-newbie) Cannot forward to a JSP within WEB-INF
Posted by Craig McClanahan <cr...@gmail.com>.
On 8/22/05, Glen Mazza <gr...@verizon.net> wrote:
> <forward name="Failure" path="/WEB-INF/pages/LoginForm.jsp"
> redirect="true"/>
> <forward name="Success" path="/WEB-INF/pages/UserQuery.jsp"
> redirect="true"/>
You are using redirects here, which causes the browser to make a
second request to the new URL. It's not legal to make a request
directly to a JSP page (or any other resource) inside the /WEB-INF
directory; you have to use forwards instead.
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org