You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Gwyn Evans <gw...@gmail.com> on 2008/05/13 17:07:02 UTC
Avoiding Relative URL tweaking...
Any thoughts on the best way to avoid the URL prefixing by
RelativePathPrefixHandler?
I'm trying to use Wicket to serve some basic WML pages, one feature of
which is that there might be a href value of "!id!..." being used,
where the "!id!" should be treated as an absolute URL prefix. The
issue I have is that I don't want it processed to 'href="../../!id!"'
which it is at the moment.
A pre-request/page solution would be the ideal, as I'm also serving
HTML pages from the same app, but could easily split the app into two
if that's simpler that way...
/Gwyn
Re: Avoiding Relative URL tweaking...
Posted by Gwyn Evans <gw...@gmail.com>.
Thanks - turns out that doing that's not enough, as it's also added to
the list of MarkupFilterChains set in
org.apache.wicket.markup.MarkupParser, so it adds a
"_relative_path_prefix_", causing a MarkupException: Unable to find
component... later!
As an alternative, I was able to get somewhere by overriding
WebApplication.newWebRequest as below, although I do need to split the
app...
protected WebRequest newWebRequest(HttpServletRequest servletRequest) {
return new ServletWebRequest(servletRequest) {
public String getRelativePathPrefixToContextRoot() {
return "";
}
};
}
/Gwyn
On Tue, May 13, 2008 at 4:24 PM, Johan Compagner <jc...@gmail.com> wrote:
> maybe
>
> IPageSettings
> public List<IComponentResolver> getComponentResolvers()
> {
> return componentResolvers;
> }
>
> and then remove the one RelativePathPrefixHandler?
>
>
>
> On Tue, May 13, 2008 at 5:07 PM, Gwyn Evans <gw...@gmail.com> wrote:
>
> > Any thoughts on the best way to avoid the URL prefixing by
> > RelativePathPrefixHandler?
> >
> > I'm trying to use Wicket to serve some basic WML pages, one feature of
> > which is that there might be a href value of "!id!..." being used,
> > where the "!id!" should be treated as an absolute URL prefix. The
> > issue I have is that I don't want it processed to 'href="../../!id!"'
> > which it is at the moment.
> >
> > A pre-request/page solution would be the ideal, as I'm also serving
> > HTML pages from the same app, but could easily split the app into two
> > if that's simpler that way...
> >
> > /Gwyn
> >
>
Re: Avoiding Relative URL tweaking...
Posted by Johan Compagner <jc...@gmail.com>.
maybe
IPageSettings
public List<IComponentResolver> getComponentResolvers()
{
return componentResolvers;
}
and then remove the one RelativePathPrefixHandler?
On Tue, May 13, 2008 at 5:07 PM, Gwyn Evans <gw...@gmail.com> wrote:
> Any thoughts on the best way to avoid the URL prefixing by
> RelativePathPrefixHandler?
>
> I'm trying to use Wicket to serve some basic WML pages, one feature of
> which is that there might be a href value of "!id!..." being used,
> where the "!id!" should be treated as an absolute URL prefix. The
> issue I have is that I don't want it processed to 'href="../../!id!"'
> which it is at the moment.
>
> A pre-request/page solution would be the ideal, as I'm also serving
> HTML pages from the same app, but could easily split the app into two
> if that's simpler that way...
>
> /Gwyn
>