You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Daan (JIRA)" <ji...@apache.org> on 2009/11/28 20:51:20 UTC

[jira] Issue Comment Edited: (WICKET-2586) [1.4.3] RequestUtils.toAbsolutePath("") skips the last value

    [ https://issues.apache.org/jira/browse/WICKET-2586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783270#action_12783270 ] 

Daan edited comment on WICKET-2586 at 11/28/09 7:50 PM:
--------------------------------------------------------

It seems this is intended behavior, looking at the code in RequestUtils:

    // Remove everything after last slash (but not slash itself)
    result = new StringBuffer(requestPath.substring(0, requestPath.lastIndexOf('/') + 1));

      was (Author: stuq):
    It seems this is intended behavior, looking at the code in RequestUtils:

{code}
    // Remove everything after last slash (but not slash itself)
    result = new StringBuffer(requestPath.substring(0, requestPath.lastIndexOf('/') + 1));
{code}
  
> [1.4.3] RequestUtils.toAbsolutePath("") skips the last value
> ------------------------------------------------------------
>
>                 Key: WICKET-2586
>                 URL: https://issues.apache.org/jira/browse/WICKET-2586
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.3
>            Reporter: smallufo
>
> The code is following :
> WebApplication :
> mountBookmarkablePage("/TestPage" , TestPage.class);
> TestPage.html :
> url = <span wicket:id="url"></span>
> TestPage.java :
> final String url = RequestUtils.toAbsolutePath("");
> add(new Label("url" , Model.of(url)));
> If I open
> http://foobar:8080/quickstart/app/TestPage 
> it shows  http://foobar:8080/quickstart/app/TestPage  , correct 
> if I open http://foobar:8080/quickstart/app/TestPage/a/b/
> it shows : http://foobar:8080/quickstart/app/TestPage/a/b/ , correct
> BUT , 
> if I open http://foobar:8080/quickstart/app/TestPage/a/b
> it shows : http://foobar:8080/quickstart/app/TestPage/a , WRONG 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.