You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thijs <vo...@gmail.com> on 2012/12/18 09:41:30 UTC
Question about UrlRenderer and WebServletResponse
Hi,
I'm trying to revive Wicket Portlets support and I'm running into a
small issue. For Liferay i've got my old 1.4 portlets working 90% with
Wicket 6 but I'm hitting a small problem with the UrlRenderer and
WebServletResponse
WebServletResponse does an optimization for tomcat in the sendRedirect
method. it strips the "./" from the url. However in the case of portlet
this causes a endless loop in some scenarios. Would it be possible to
put this "optimization" in the UrlRenderer? So that we can choose to
override this by providing a custom PortletUrlRenderer.
While digging into this I also came a cross another thing.
WebServletResponse.encodeRedirectURL(url) uses "new
UrlRenderer(webRequest)" while WebServletResponse. encodeUrl(url) uses
the RequestCycle.get().getUrlRenderer(). Why doesn't
WebServletResponse.encodeRedirectURL(url) use
RequestCycle.get().getUrlRenderer(). As this last method gives the
custom UrlRenderer back that we use in the PortletRequestCylce instead
of just the default.
Kind regard
Thijs
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Question about UrlRenderer and WebServletResponse
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
On Tue, Dec 18, 2012 at 10:41 AM, Thijs <vo...@gmail.com> wrote:
> Hi,
>
> I'm trying to revive Wicket Portlets support and I'm running into a small
> issue. For Liferay i've got my old 1.4 portlets working 90% with Wicket 6
> but I'm hitting a small problem with the UrlRenderer and WebServletResponse
>
> WebServletResponse does an optimization for tomcat in the sendRedirect
> method. it strips the "./" from the url. However in the case of portlet
> this causes a endless loop in some scenarios. Would it be possible to put
> this "optimization" in the UrlRenderer? So that we can choose to override
> this by providing a custom PortletUrlRenderer.
>
Please send a .patch that fixes the issue for Portlets and still keeps all
the tests green.
>
> While digging into this I also came a cross another thing.
> WebServletResponse.**encodeRedirectURL(url) uses "new
> UrlRenderer(webRequest)" while WebServletResponse. encodeUrl(url) uses the
> RequestCycle.get().**getUrlRenderer(). Why doesn't WebServletResponse.**encodeRedirectURL(url)
> use RequestCycle.get().**getUrlRenderer(). As this last method gives the
> custom UrlRenderer back that we use in the PortletRequestCylce instead of
> just the default.
>
Because at this point there is no RequestCycle.
http://markmail.org/thread/qsdfhrbowb5tszxr
I chose the simpler solution to create a new UrlRenderer.
It seems we will need to extend the life of RequestCycle or create a
completely new one just for getting a proper UrlRenderer.
>
> Kind regard
>
> Thijs
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.org<us...@wicket.apache.org>
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>