[ 
https://issues.apache.org/jira/browse/WICKET-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

smallufo updated WICKET-2312:
-----------------------------

    Attachment: src-wicket-2312.tar.gz

This is my quickstart code :

Step :

Deploy :
The webapp context is "quickstart"
WicketServlet listens to "/app/*" :

  <servlet>
    <servlet-name>TestApp</servlet-name>
    <servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
    <init-param>
      <param-name>applicationClassName</param-name>
      <param-value>quickstart.MainApplication</param-value>
    </init-param>
    <init-param>
      <param-name>configuration</param-name>
      <param-value>DEPLOYMENT</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  
  <servlet-mapping>
    <servlet-name>TestApp</servlet-name>
    <url-pattern>/app/*</url-pattern>
  </servlet-mapping>

The "CurrentPage" is mounted to "/CurrentPage" by 
  mountBookmarkablePage("/CurrentPage" , CurrentPage.class);

Test steps :

Step 1:
user browser to link to http://foo.bar:8080/quickstart/app/CurrentPage

outer = http://foo.bar:8080/quickstart/app/CurrentPage
inner = http://foo.bar:8080/quickstart/app/CurrentPage

both are correct.

But ...

Step 2:
Open browser to connect to :
http://foo.bar:8080/quickstart/app/CurrentPage/key/value
outer = http://foo.bar:8080/quickstart/app/CurrentPage/key/value/
inner = http://foo.bar:8080/CurrentPage/key/value/

"outer" is correct , but "inner" is wrong !
"inner" lacks of context("quickstart") and path("app") here.


> RequestUtils.toAbsolutePath() not output hostname and url-pattern in AJAX
> -------------------------------------------------------------------------
>
>                 Key: WICKET-2312
>                 URL: https://issues.apache.org/jira/browse/WICKET-2312
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.6
>         Environment: CentOS release 5.2 , systemwide UTF-8 , resin-3.1.6 , 
> use WicketServlet instead of WicketFilter
>            Reporter: smallufo
>         Attachments: src-wicket-2312.tar.gz
>
>
> This is my code :
> String a1 = 
> RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , 
> pps).toString());
> System.out.println("a1 = " + a1);
> Link link = new AjaxFallbackLink("link")
> {
>   @Override
>   public void onClick(AjaxRequestTarget target)
>   {
>     String a2 = 
> RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , 
> pps).toString());
>     System.out.println("a2 = " + a2);
>   }
> };
> The wicket application's url-pattern is "/app/*"
> I am viewing a mounted bookmarkable page : CurrentPage , with an AJAX-link.
> I want to get the absolute Path in the AJAX onClick() method ,
> Here is the output :
> a1 = http://foo.bar/app/CurrentPage/para1/value1
> a2 = http:///CurrentPage/para1/value1
> a1 is correct , while a2 lacks of hostname and url pattern (which 
> WicketServlet listens to)

-- 
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