You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joel Hill <Hi...@michigan.gov> on 2007/08/10 22:51:49 UTC

RequestDispather.forward()

Would the fact that wicket now uses a filter instead of a servlet have
an effect on trying to forward a request.  I'm trying to forward a
request from the jsp/servlet portion of our app to a bookmarkable wicket
page using RequestDispatcher.forward(), but no matter what sort of path
I send it, I get a null value when trying to create my RequestDispatcher
object.

My wicket filter is mapped to /wicket/*, and as an experiment I tried
to forward to my app's home page.  I tried passing "/wicket/",
"wicket/", and even "/wicket" (which shouldn't work), an neither case
allowed me to create a RequestDispatcher (using
request.getRequestDispatcher()).  If I simply pass "/" id does forward
to my app's welcome page, and I think even passing a path for my servlet
(where the forward is occuring--or trying to at least) is recognized;
but I can't get it to recognize the wicket app.

I tried including

<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>

in the filter-mapping of my web.xml, since it looked like that might
solve it, but no luck.  It would be nice if I could find some way to
redirect from the old servlet back to wicket, but I haven't figured it
out yet.  I've started experimenting with response.senRedirect(), but so
far that's not looking promising either.  Why won't my app server
recognize my wicket path?  Thanks.


Joel

P.S. If someone tells me they think it's oc4j again (my app server) I
think I may cry. lol


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: RequestDispather.forward()

Posted by hillj2 <Hi...@michigan.gov>.
I didn't know you could still use the servlet in 1.3.  As it turns out,
switching to using the servlet did fix the problem.  I don't know if that's
a problem with the filter or with the way I had things set up.  The
downside, I've now discovered, is that after doing the forward the app now
thinks it's running under the servlet/jsp app's path and not the wicket
path, which is causing its own issues.

I think I'd almost rather accomplish this using a redirect instead; however
our reverse proxy seems to have issues with redirects.  I already had to
switch to one pass rendering because of it.  Maybe one of these days someone
will actually figure out that issue and fix it.  Too bad I don't have access
to it.  If you want something done right...or at all sometimes...you have to
do it yourself. :)

If only I had time to convert the whole app over to wicket now; but I don't. 
But enough venting on the mailing list.

Thanks for the help, Eelco.

Joel



Eelco Hillenius wrote:
> 
>> Would the fact that wicket now uses a filter instead of a servlet have
>> an effect on trying to forward a request.  I'm trying to forward a
>> request from the jsp/servlet portion of our app to a bookmarkable wicket
>> page using RequestDispatcher.forward(), but no matter what sort of path
>> I send it, I get a null value when trying to create my RequestDispatcher
>> object.
>>
>> My wicket filter is mapped to /wicket/*, and as an experiment I tried
>> to forward to my app's home page.  I tried passing "/wicket/",
>> "wicket/", and even "/wicket" (which shouldn't work), an neither case
>> allowed me to create a RequestDispatcher (using
>> request.getRequestDispatcher()).  If I simply pass "/" id does forward
>> to my app's welcome page, and I think even passing a path for my servlet
>> (where the forward is occuring--or trying to at least) is recognized;
>> but I can't get it to recognize the wicket app.
>>
>> I tried including
>>
>> <dispatcher>REQUEST</dispatcher>
>> <dispatcher>FORWARD</dispatcher>
>>
>> in the filter-mapping of my web.xml, since it looked like that might
>> solve it, but no luck.  It would be nice if I could find some way to
>> redirect from the old servlet back to wicket, but I haven't figured it
>> out yet.  I've started experimenting with response.senRedirect(), but so
>> far that's not looking promising either.  Why won't my app server
>> recognize my wicket path?  Thanks.
>>
>>
>> Joel
>>
>> P.S. If someone tells me they think it's oc4j again (my app server) I
>> think I may cry. lol
> 
> No idea. You can still use a servlet with Wicket 1.3 if you want to
> test whether that makes the difference (sounds very unlikely to me,
> but if you test it you can make sure) and if you think it might be
> oc4j, you can simply test it with another servlet container and see
> whether the same problem exists.
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/RequestDispather.forward%28%29-tf4251039.html#a12130211
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: RequestDispather.forward()

Posted by Eelco Hillenius <ee...@gmail.com>.
> Would the fact that wicket now uses a filter instead of a servlet have
> an effect on trying to forward a request.  I'm trying to forward a
> request from the jsp/servlet portion of our app to a bookmarkable wicket
> page using RequestDispatcher.forward(), but no matter what sort of path
> I send it, I get a null value when trying to create my RequestDispatcher
> object.
>
> My wicket filter is mapped to /wicket/*, and as an experiment I tried
> to forward to my app's home page.  I tried passing "/wicket/",
> "wicket/", and even "/wicket" (which shouldn't work), an neither case
> allowed me to create a RequestDispatcher (using
> request.getRequestDispatcher()).  If I simply pass "/" id does forward
> to my app's welcome page, and I think even passing a path for my servlet
> (where the forward is occuring--or trying to at least) is recognized;
> but I can't get it to recognize the wicket app.
>
> I tried including
>
> <dispatcher>REQUEST</dispatcher>
> <dispatcher>FORWARD</dispatcher>
>
> in the filter-mapping of my web.xml, since it looked like that might
> solve it, but no luck.  It would be nice if I could find some way to
> redirect from the old servlet back to wicket, but I haven't figured it
> out yet.  I've started experimenting with response.senRedirect(), but so
> far that's not looking promising either.  Why won't my app server
> recognize my wicket path?  Thanks.
>
>
> Joel
>
> P.S. If someone tells me they think it's oc4j again (my app server) I
> think I may cry. lol

No idea. You can still use a servlet with Wicket 1.3 if you want to
test whether that makes the difference (sounds very unlikely to me,
but if you test it you can make sure) and if you think it might be
oc4j, you can simply test it with another servlet container and see
whether the same problem exists.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org