You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Christian Grobmeier <gr...@gmail.com> on 2011/02/16 14:21:36 UTC
1.5 is missing RequestUtils method
Hi,
with commit 895520 from 04.01.2010 the
RequstUtils.toAbsolutePath(final String relativePagePath) method
disappeared without warning
This one was very useful and has never marked as deprecated. I am
wondering if this was by accident - the commit was very huge. It was
the RequestCycle refactoring.
The method in questions is:
/**
* Calculates absolute path to url relative to another absolute url.
*
* @param relativePagePath
* path, relative to requestPath
* @return absolute path for given url
*/
public final static String toAbsolutePath(final String relativePagePath)
{
HttpServletRequest req =
((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
return toAbsolutePath(req.getRequestURL().toString(), relativePagePath);
}
Best regards,
Christian
--
http://www.grobmeier.de
Re: 1.5 is missing RequestUtils method
Posted by Christian Grobmeier <gr...@gmail.com>.
https://issues.apache.org/jira/browse/WICKET-3447
Thanks for your help
On Wed, Feb 16, 2011 at 2:49 PM, Martin Grigorov <mg...@apache.org> wrote:
> File a ticket
>
> On Wed, Feb 16, 2011 at 3:39 PM, Christian Grobmeier <gr...@gmail.com>wrote:
>
>> > try with
>> > requestCycle.getUrlRenderer().renderFullUrl(Url.parse(relativePath))
>>
>> This:
>>
>> String url2 =
>> RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(urlFor(ActivationPage.class,
>> null).toString()));
>>
>> outputs:
>> http://localhost:8080/../login/ActivationPage
>>
>> This link is wrong b/c of the .. in it. Did I use it wrong?
>>
>>
>> My method based on the original one:
>>
>> public final static String toAbsolutePath(final String relativePagePath)
>> {
>> HttpServletRequest req = (HttpServletRequest)
>> ((WebRequest)RequestCycle.get().getRequest()).getContainerRequest();
>> return RequestUtils.toAbsolutePath(req.getRequestURL().toString(),
>> relativePagePath);
>> }
>>
>> outputs:
>> http://localhost:8080/login/ActivationPage
>>
>> This doesn't abstract the low level request, but what else should it
>> be than a HttpServletRequest??
>>
>> Best regards,
>> Christian
>>
>>
>>
>> >
>> > this is new method which will be available in 1.5-RC2
>> >
>> > let us know if you face problems
>> >
>> > On Wed, Feb 16, 2011 at 3:21 PM, Christian Grobmeier <
>> grobmeier@gmail.com>wrote:
>> >
>> >> Hi,
>> >>
>> >> with commit 895520 from 04.01.2010 the
>> >> RequstUtils.toAbsolutePath(final String relativePagePath) method
>> >> disappeared without warning
>> >>
>> >> This one was very useful and has never marked as deprecated. I am
>> >> wondering if this was by accident - the commit was very huge. It was
>> >> the RequestCycle refactoring.
>> >>
>> >> The method in questions is:
>> >>
>> >> /**
>> >> * Calculates absolute path to url relative to another absolute
>> url.
>> >> *
>> >> * @param relativePagePath
>> >> * path, relative to requestPath
>> >> * @return absolute path for given url
>> >> */
>> >> public final static String toAbsolutePath(final String
>> >> relativePagePath)
>> >> {
>> >> HttpServletRequest req =
>> >> ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
>> >> return toAbsolutePath(req.getRequestURL().toString(),
>> >> relativePagePath);
>> >> }
>> >>
>> >> Best regards,
>> >> Christian
>> >>
>> >> --
>> >> http://www.grobmeier.de
>> >>
>> >
>>
>>
>>
>> --
>> http://www.grobmeier.de
>>
>
--
http://www.grobmeier.de
Re: 1.5 is missing RequestUtils method
Posted by Martin Grigorov <mg...@apache.org>.
File a ticket
On Wed, Feb 16, 2011 at 3:39 PM, Christian Grobmeier <gr...@gmail.com>wrote:
> > try with
> > requestCycle.getUrlRenderer().renderFullUrl(Url.parse(relativePath))
>
> This:
>
> String url2 =
> RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(urlFor(ActivationPage.class,
> null).toString()));
>
> outputs:
> http://localhost:8080/../login/ActivationPage
>
> This link is wrong b/c of the .. in it. Did I use it wrong?
>
>
> My method based on the original one:
>
> public final static String toAbsolutePath(final String relativePagePath)
> {
> HttpServletRequest req = (HttpServletRequest)
> ((WebRequest)RequestCycle.get().getRequest()).getContainerRequest();
> return RequestUtils.toAbsolutePath(req.getRequestURL().toString(),
> relativePagePath);
> }
>
> outputs:
> http://localhost:8080/login/ActivationPage
>
> This doesn't abstract the low level request, but what else should it
> be than a HttpServletRequest??
>
> Best regards,
> Christian
>
>
>
> >
> > this is new method which will be available in 1.5-RC2
> >
> > let us know if you face problems
> >
> > On Wed, Feb 16, 2011 at 3:21 PM, Christian Grobmeier <
> grobmeier@gmail.com>wrote:
> >
> >> Hi,
> >>
> >> with commit 895520 from 04.01.2010 the
> >> RequstUtils.toAbsolutePath(final String relativePagePath) method
> >> disappeared without warning
> >>
> >> This one was very useful and has never marked as deprecated. I am
> >> wondering if this was by accident - the commit was very huge. It was
> >> the RequestCycle refactoring.
> >>
> >> The method in questions is:
> >>
> >> /**
> >> * Calculates absolute path to url relative to another absolute
> url.
> >> *
> >> * @param relativePagePath
> >> * path, relative to requestPath
> >> * @return absolute path for given url
> >> */
> >> public final static String toAbsolutePath(final String
> >> relativePagePath)
> >> {
> >> HttpServletRequest req =
> >> ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
> >> return toAbsolutePath(req.getRequestURL().toString(),
> >> relativePagePath);
> >> }
> >>
> >> Best regards,
> >> Christian
> >>
> >> --
> >> http://www.grobmeier.de
> >>
> >
>
>
>
> --
> http://www.grobmeier.de
>
Re: 1.5 is missing RequestUtils method
Posted by Christian Grobmeier <gr...@gmail.com>.
> try with
> requestCycle.getUrlRenderer().renderFullUrl(Url.parse(relativePath))
This:
String url2 = RequestCycle.get().getUrlRenderer().renderFullUrl(Url.parse(urlFor(ActivationPage.class,
null).toString()));
outputs:
http://localhost:8080/../login/ActivationPage
This link is wrong b/c of the .. in it. Did I use it wrong?
My method based on the original one:
public final static String toAbsolutePath(final String relativePagePath)
{
HttpServletRequest req = (HttpServletRequest)
((WebRequest)RequestCycle.get().getRequest()).getContainerRequest();
return RequestUtils.toAbsolutePath(req.getRequestURL().toString(),
relativePagePath);
}
outputs:
http://localhost:8080/login/ActivationPage
This doesn't abstract the low level request, but what else should it
be than a HttpServletRequest??
Best regards,
Christian
>
> this is new method which will be available in 1.5-RC2
>
> let us know if you face problems
>
> On Wed, Feb 16, 2011 at 3:21 PM, Christian Grobmeier <gr...@gmail.com>wrote:
>
>> Hi,
>>
>> with commit 895520 from 04.01.2010 the
>> RequstUtils.toAbsolutePath(final String relativePagePath) method
>> disappeared without warning
>>
>> This one was very useful and has never marked as deprecated. I am
>> wondering if this was by accident - the commit was very huge. It was
>> the RequestCycle refactoring.
>>
>> The method in questions is:
>>
>> /**
>> * Calculates absolute path to url relative to another absolute url.
>> *
>> * @param relativePagePath
>> * path, relative to requestPath
>> * @return absolute path for given url
>> */
>> public final static String toAbsolutePath(final String
>> relativePagePath)
>> {
>> HttpServletRequest req =
>> ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
>> return toAbsolutePath(req.getRequestURL().toString(),
>> relativePagePath);
>> }
>>
>> Best regards,
>> Christian
>>
>> --
>> http://www.grobmeier.de
>>
>
--
http://www.grobmeier.de
Re: 1.5 is missing RequestUtils method
Posted by Martin Grigorov <mg...@apache.org>.
try with
requestCycle.getUrlRenderer().renderFullUrl(Url.parse(relativePath))
this is new method which will be available in 1.5-RC2
let us know if you face problems
On Wed, Feb 16, 2011 at 3:21 PM, Christian Grobmeier <gr...@gmail.com>wrote:
> Hi,
>
> with commit 895520 from 04.01.2010 the
> RequstUtils.toAbsolutePath(final String relativePagePath) method
> disappeared without warning
>
> This one was very useful and has never marked as deprecated. I am
> wondering if this was by accident - the commit was very huge. It was
> the RequestCycle refactoring.
>
> The method in questions is:
>
> /**
> * Calculates absolute path to url relative to another absolute url.
> *
> * @param relativePagePath
> * path, relative to requestPath
> * @return absolute path for given url
> */
> public final static String toAbsolutePath(final String
> relativePagePath)
> {
> HttpServletRequest req =
> ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
> return toAbsolutePath(req.getRequestURL().toString(),
> relativePagePath);
> }
>
> Best regards,
> Christian
>
> --
> http://www.grobmeier.de
>