RequestUtils.toAbsolutePath()'s bug
-----------------------------------

                 Key: WICKET-1599
                 URL: https://issues.apache.org/jira/browse/WICKET-1599
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.3
         Environment: Firefox
            Reporter: smallufo


Suppose the following code in a bookmarkable page , say "FirstPage" :

When user pushes an AJAX button , the page builds a bookmarkable link :

Map<String , Object> parameterMap = new HashMap<String , Object>();
parameterMap.put("index" , myObj.getIndex());
PageParameters pps = new PageParameters(parameterMap);
String absUrl = 
RequestUtils.toAbsolutePath(getRequestCycle().urlFor(SecondPage.class , 
pps).toString());

If the user navigates properly (by clicking links to the FirstPage) ,
the absUrl is correct : foobar/SecondPage/index/1/
after pre-adding "http://"; + req.getServerName() + contextPath + "/" , I can 
correctly build the (bookmarkable) link like this :
http://www.foobar.com/app/foobar/SecondPage/index/1


BUT , if the user directly links to the FirstPage(copy / paste the FirstPage's 
url in the browser's url bar) ,
or clicks the SecondPage's link and back (by browser) , and pushes the AJAX 
button again...
SOMETIMES , absUrl becomes :
http://foobar/SecondPage/index/1/ , the preceding "http://"; is redundant !!!
And , my bookmarkable link becomes : 
http://www.foobar.com/app/http://foobar/SecondPage/index/1

I can not successfully re-produce this error every time. but sometimes it just 
occurs .
It seems it is a bug...

PS : I know how to build a BookmarkablePageLink in the wicket way , But I have 
to do this for a special purpose.....(parsing an article and adding links to 
some keywords)

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

Reply via email to