You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jonathan Gray <jo...@f-i.com> on 2011/07/14 19:10:02 UTC

getRelativePathPrefixToWicketHandler & String index out of range

please excuse me if this is a dupe - i posted to the general apache forum
and then MOVED it to the users forum & i wasn't sure if the post would go to
the mailing list if it was moved rather than originally posted
there...anyway:


i have seen this error reported several times and i have seen wicket devs
come back and say that it is fixed.  what i see is that all versions of
wicket from 1.4.11 - 1.4.17 have this exact problem.  i have a number of
RESTful calls to an app that are rewritten w mod_rewrite.  the rewritten
requests are processed by a MultiActionController and which then uses
RequestDispatcher.forward to pass the request on to my custom
WebRequestCycle.  Anything that is rewritten by mod_rewrite in 1.4.11 or
greater throws the StringIndexOutOfBounds exception in the *
getRelativePathPrefixToWicketHandler* method when it tries to do this:


relativeUrl = filterPath == null ? relativeUrl :
relativeUrl.substring(filterPath.length());


because the forwardUrl = '/rw' and the relativeUrl =
'account/updates/14883'.  can someone please offer a workaround for this?
 let me know if you need more information.  upgrading to 1.5 is fine and
all, but i would like to get this working in 1.4, too.  i have seen several
threads on this problem but nothing that definitively  tells me what the
solution is.

thanks.

Re: getRelativePathPrefixToWicketHandler & String index out of range

Posted by Martin Grigorov <mg...@apache.org>.
I know people in the mailing lists said that the combination
mod_rewrite + Wicket works for them.
Maybe you forgot some mod_rewrite setting, or you added one that
breaks the things... Without a quickstart/tutorial I'm unable to help
you.

On Fri, Jul 15, 2011 at 5:09 PM, nojyarg <jo...@f-i.com> wrote:
> you asked "what is forwardUrl" - it is the httprequest attribute
> javax.servlet.forward.servlet_path & forwardUrl is just the variable name
> that this attribute is assigned to in the
> ServletWebRequest.getRelativePathPrefixToWicketHandler method.
>
> i will try to get 1.5 going.  it seems strange to me, however, that
> mod_rewrite and wicket requestdispatcher + servletwebrequest don't play nice
> together seeing as how both mod_rewrite & Wicket are popular & somewhat
> mature apache technologies.
>
> re: tutorial.  well, it's probably going to take too much back and forth to
> make it worth either of our time to do this.
>
> thanks.
>
> - j
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/getRelativePathPrefixToWicketHandler-String-index-out-of-range-tp3668486p3670029.html
> Sent from the Users forum 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
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: getRelativePathPrefixToWicketHandler & String index out of range

Posted by nojyarg <jo...@f-i.com>.
you asked "what is forwardUrl" - it is the httprequest attribute
javax.servlet.forward.servlet_path & forwardUrl is just the variable name
that this attribute is assigned to in the
ServletWebRequest.getRelativePathPrefixToWicketHandler method.

i will try to get 1.5 going.  it seems strange to me, however, that
mod_rewrite and wicket requestdispatcher + servletwebrequest don't play nice
together seeing as how both mod_rewrite & Wicket are popular & somewhat
mature apache technologies.  

re: tutorial.  well, it's probably going to take too much back and forth to
make it worth either of our time to do this.

thanks.

- j

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getRelativePathPrefixToWicketHandler-String-index-out-of-range-tp3668486p3670029.html
Sent from the Users forum 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: getRelativePathPrefixToWicketHandler & String index out of range

Posted by Martin Grigorov <mg...@apache.org>.
Hi

On Thu, Jul 14, 2011 at 8:10 PM, Jonathan Gray <jo...@f-i.com> wrote:
> please excuse me if this is a dupe - i posted to the general apache forum
> and then MOVED it to the users forum & i wasn't sure if the post would go to
> the mailing list if it was moved rather than originally posted
> there...anyway:
>
>
> i have seen this error reported several times and i have seen wicket devs
> come back and say that it is fixed.  what i see is that all versions of
> wicket from 1.4.11 - 1.4.17 have this exact problem.  i have a number of
> RESTful calls to an app that are rewritten w mod_rewrite.  the rewritten
> requests are processed by a MultiActionController and which then uses
> RequestDispatcher.forward to pass the request on to my custom
> WebRequestCycle.  Anything that is rewritten by mod_rewrite in 1.4.11 or
> greater throws the StringIndexOutOfBounds exception in the *
> getRelativePathPrefixToWicketHandler* method when it tries to do this:
>
>
> relativeUrl = filterPath == null ? relativeUrl :
> relativeUrl.substring(filterPath.length());
>
>
> because the forwardUrl = '/rw' and the relativeUrl =
What is 'forwardUrl' ?
> 'account/updates/14883'.  can someone please offer a workaround for this?
>  let me know if you need more information.  upgrading to 1.5 is fine and
> all, but i would like to get this working in 1.4, too.
This specific logic has been removed in Wicket 1.5 so the chance your
app to work is much bigger.
If it is broken then please create a tutorial how to setup Apache
HTTPD and the Wicket application so we can debug it and fix it.

There is similar issue
https://issues.apache.org/jira/browse/WICKET-2836 - but it as I said
this is improved in 1.5.

 i have seen several
> threads on this problem but nothing that definitively  tells me what the
> solution is.
>
> thanks.
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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