You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "smallufo (JIRA)" <ji...@apache.org> on 2009/12/22 21:50:29 UTC

[jira] Created: (WICKET-2632) RequestUtils.toAbsolutePath is very problematic in AJAX

RequestUtils.toAbsolutePath is very problematic in AJAX
-------------------------------------------------------

                 Key: WICKET-2632
                 URL: https://issues.apache.org/jira/browse/WICKET-2632
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.5
         Environment: Linux , Resin 3.1.9  , JDK 1.6.0_17
            Reporter: smallufo


This bug is similar to WICKET-2312 https://issues.apache.org/jira/browse/WICKET-2312
WICKET-2312 is about link  , and this bug is about Button

The whole WicketServlet is mapped by <url-pattern>/app/*</url-pattern>

The code is simple :
HTML :

<form wicket:id="form">
  <input type="button" wicket:id="button" value="click me"/>
</form>

Java Code : CurrentPage.java (it is mounted to '/CurrentPage'  )

String a1 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
System.out.println("outer = " + a1);

Form form = new Form("form");
add(form);

Button button = new AjaxButton("button")
{
  @Override
  protected void onSubmit(AjaxRequestTarget target, Form<?> form)
  {
    String a2 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
    System.out.println("inner = " + a2);
  }
};
form.add(button);

When browsing 
http://foobar.com:8080/quickstart/app/CurrentPage
Everything is fine :
outer = http://foobar.com:8080/quickstart/app/CurrentPage
inner = http://foobar.com:8080/quickstart/app/CurrentPage

But if I browse 
http://foobar.com:8080/quickstart/app/CurrentPage/
With trailing slash ,  it goes wrong :

outer = http://foobar.com:8080/quickstart/app/CurrentPage
inner = http://foobar.com:8080/quickstart/CurrentPage

The "app" (WicketServlet's url-pattern) is gone ... , and the trailing slash is gone, too.

And more ... if I further browse 
http://foobar.com:8080/quickstart/app/CurrentPage/key/value
The problem goes more severe :
outer = http://foobar.com:8080/quickstart/app/CurrentPage/key/value
inner = http://foobar.com:8080/CurrentPage/key/value

web-app's context (quickstart) , and WicketServlet's url-pattern are both gone !!!


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


[jira] Resolved: (WICKET-2632) RequestUtils.toAbsolutePath is very problematic in AJAX

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2632.
-----------------------------------

    Resolution: Cannot Reproduce
      Assignee: Igor Vaynberg

i could not reproduce after applying WICKET-2312.

if you still can reproduce it please provide a quickstart generated with the maven archetype on http://wicket.apache.org/quickstart.html

> RequestUtils.toAbsolutePath is very problematic in AJAX
> -------------------------------------------------------
>
>                 Key: WICKET-2632
>                 URL: https://issues.apache.org/jira/browse/WICKET-2632
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>         Environment: Linux , Resin 3.1.9  , JDK 1.6.0_17
>            Reporter: smallufo
>            Assignee: Igor Vaynberg
>         Attachments: quickstart.tar.gz
>
>
> This bug is similar to WICKET-2312 
> WICKET-2312 is about link  , and this bug is about Button
> I test in the latest 1.4.5 
> The whole WicketServlet is mapped by <url-pattern>/app/*</url-pattern>
> The code is simple :
> HTML :
> <form wicket:id="form">
>   <input type="button" wicket:id="button" value="click me"/>
> </form>
> Java Code : CurrentPage.java (it is mounted to '/CurrentPage'  )
> String a1 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
> System.out.println("outer = " + a1);
> Form form = new Form("form");
> add(form);
> Button button = new AjaxButton("button")
> {
>   @Override
>   protected void onSubmit(AjaxRequestTarget target, Form<?> form)
>   {
>     String a2 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
>     System.out.println("inner = " + a2);
>   }
> };
> form.add(button);
> When browsing 
> http://foobar.com:8080/quickstart/app/CurrentPage
> Everything is fine :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage
> inner = http://foobar.com:8080/quickstart/app/CurrentPage
> But if I browse 
> http://foobar.com:8080/quickstart/app/CurrentPage/
> With trailing slash ,  it goes wrong :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage
> inner = http://foobar.com:8080/quickstart/CurrentPage
> The "app" (WicketServlet's url-pattern) is gone ... , and the trailing slash is gone, too.
> And more ... if I further browse 
> http://foobar.com:8080/quickstart/app/CurrentPage/key/value
> The problem goes more severe :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage/key/value
> inner = http://foobar.com:8080/CurrentPage/key/value
> web-app's context (quickstart) , and WicketServlet's url-pattern are both gone !!!

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


[jira] Updated: (WICKET-2632) RequestUtils.toAbsolutePath is very problematic in AJAX

Posted by "smallufo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

smallufo updated WICKET-2632:
-----------------------------

    Description: 
This bug is similar to WICKET-2312 
WICKET-2312 is about link  , and this bug is about Button
I test in the latest 1.4.5 

The whole WicketServlet is mapped by <url-pattern>/app/*</url-pattern>

The code is simple :
HTML :

<form wicket:id="form">
  <input type="button" wicket:id="button" value="click me"/>
</form>

Java Code : CurrentPage.java (it is mounted to '/CurrentPage'  )

String a1 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
System.out.println("outer = " + a1);

Form form = new Form("form");
add(form);

Button button = new AjaxButton("button")
{
  @Override
  protected void onSubmit(AjaxRequestTarget target, Form<?> form)
  {
    String a2 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
    System.out.println("inner = " + a2);
  }
};
form.add(button);

When browsing 
http://foobar.com:8080/quickstart/app/CurrentPage
Everything is fine :
outer = http://foobar.com:8080/quickstart/app/CurrentPage
inner = http://foobar.com:8080/quickstart/app/CurrentPage

But if I browse 
http://foobar.com:8080/quickstart/app/CurrentPage/
With trailing slash ,  it goes wrong :

outer = http://foobar.com:8080/quickstart/app/CurrentPage
inner = http://foobar.com:8080/quickstart/CurrentPage

The "app" (WicketServlet's url-pattern) is gone ... , and the trailing slash is gone, too.

And more ... if I further browse 
http://foobar.com:8080/quickstart/app/CurrentPage/key/value
The problem goes more severe :
outer = http://foobar.com:8080/quickstart/app/CurrentPage/key/value
inner = http://foobar.com:8080/CurrentPage/key/value

web-app's context (quickstart) , and WicketServlet's url-pattern are both gone !!!


  was:
This bug is similar to WICKET-2312 https://issues.apache.org/jira/browse/WICKET-2312
WICKET-2312 is about link  , and this bug is about Button

The whole WicketServlet is mapped by <url-pattern>/app/*</url-pattern>

The code is simple :
HTML :

<form wicket:id="form">
  <input type="button" wicket:id="button" value="click me"/>
</form>

Java Code : CurrentPage.java (it is mounted to '/CurrentPage'  )

String a1 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
System.out.println("outer = " + a1);

Form form = new Form("form");
add(form);

Button button = new AjaxButton("button")
{
  @Override
  protected void onSubmit(AjaxRequestTarget target, Form<?> form)
  {
    String a2 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
    System.out.println("inner = " + a2);
  }
};
form.add(button);

When browsing 
http://foobar.com:8080/quickstart/app/CurrentPage
Everything is fine :
outer = http://foobar.com:8080/quickstart/app/CurrentPage
inner = http://foobar.com:8080/quickstart/app/CurrentPage

But if I browse 
http://foobar.com:8080/quickstart/app/CurrentPage/
With trailing slash ,  it goes wrong :

outer = http://foobar.com:8080/quickstart/app/CurrentPage
inner = http://foobar.com:8080/quickstart/CurrentPage

The "app" (WicketServlet's url-pattern) is gone ... , and the trailing slash is gone, too.

And more ... if I further browse 
http://foobar.com:8080/quickstart/app/CurrentPage/key/value
The problem goes more severe :
outer = http://foobar.com:8080/quickstart/app/CurrentPage/key/value
inner = http://foobar.com:8080/CurrentPage/key/value

web-app's context (quickstart) , and WicketServlet's url-pattern are both gone !!!



> RequestUtils.toAbsolutePath is very problematic in AJAX
> -------------------------------------------------------
>
>                 Key: WICKET-2632
>                 URL: https://issues.apache.org/jira/browse/WICKET-2632
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>         Environment: Linux , Resin 3.1.9  , JDK 1.6.0_17
>            Reporter: smallufo
>         Attachments: quickstart.tar.gz
>
>
> This bug is similar to WICKET-2312 
> WICKET-2312 is about link  , and this bug is about Button
> I test in the latest 1.4.5 
> The whole WicketServlet is mapped by <url-pattern>/app/*</url-pattern>
> The code is simple :
> HTML :
> <form wicket:id="form">
>   <input type="button" wicket:id="button" value="click me"/>
> </form>
> Java Code : CurrentPage.java (it is mounted to '/CurrentPage'  )
> String a1 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
> System.out.println("outer = " + a1);
> Form form = new Form("form");
> add(form);
> Button button = new AjaxButton("button")
> {
>   @Override
>   protected void onSubmit(AjaxRequestTarget target, Form<?> form)
>   {
>     String a2 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
>     System.out.println("inner = " + a2);
>   }
> };
> form.add(button);
> When browsing 
> http://foobar.com:8080/quickstart/app/CurrentPage
> Everything is fine :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage
> inner = http://foobar.com:8080/quickstart/app/CurrentPage
> But if I browse 
> http://foobar.com:8080/quickstart/app/CurrentPage/
> With trailing slash ,  it goes wrong :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage
> inner = http://foobar.com:8080/quickstart/CurrentPage
> The "app" (WicketServlet's url-pattern) is gone ... , and the trailing slash is gone, too.
> And more ... if I further browse 
> http://foobar.com:8080/quickstart/app/CurrentPage/key/value
> The problem goes more severe :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage/key/value
> inner = http://foobar.com:8080/CurrentPage/key/value
> web-app's context (quickstart) , and WicketServlet's url-pattern are both gone !!!

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


[jira] Updated: (WICKET-2632) RequestUtils.toAbsolutePath is very problematic in AJAX

Posted by "smallufo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

smallufo updated WICKET-2632:
-----------------------------

    Attachment: quickstart.tar.gz

Quickstart file

> RequestUtils.toAbsolutePath is very problematic in AJAX
> -------------------------------------------------------
>
>                 Key: WICKET-2632
>                 URL: https://issues.apache.org/jira/browse/WICKET-2632
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.5
>         Environment: Linux , Resin 3.1.9  , JDK 1.6.0_17
>            Reporter: smallufo
>         Attachments: quickstart.tar.gz
>
>
> This bug is similar to WICKET-2312 https://issues.apache.org/jira/browse/WICKET-2312
> WICKET-2312 is about link  , and this bug is about Button
> The whole WicketServlet is mapped by <url-pattern>/app/*</url-pattern>
> The code is simple :
> HTML :
> <form wicket:id="form">
>   <input type="button" wicket:id="button" value="click me"/>
> </form>
> Java Code : CurrentPage.java (it is mounted to '/CurrentPage'  )
> String a1 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
> System.out.println("outer = " + a1);
> Form form = new Form("form");
> add(form);
> Button button = new AjaxButton("button")
> {
>   @Override
>   protected void onSubmit(AjaxRequestTarget target, Form<?> form)
>   {
>     String a2 = RequestUtils.toAbsolutePath(getRequestCycle().urlFor(CurrentPage.class , pps).toString());
>     System.out.println("inner = " + a2);
>   }
> };
> form.add(button);
> When browsing 
> http://foobar.com:8080/quickstart/app/CurrentPage
> Everything is fine :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage
> inner = http://foobar.com:8080/quickstart/app/CurrentPage
> But if I browse 
> http://foobar.com:8080/quickstart/app/CurrentPage/
> With trailing slash ,  it goes wrong :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage
> inner = http://foobar.com:8080/quickstart/CurrentPage
> The "app" (WicketServlet's url-pattern) is gone ... , and the trailing slash is gone, too.
> And more ... if I further browse 
> http://foobar.com:8080/quickstart/app/CurrentPage/key/value
> The problem goes more severe :
> outer = http://foobar.com:8080/quickstart/app/CurrentPage/key/value
> inner = http://foobar.com:8080/CurrentPage/key/value
> web-app's context (quickstart) , and WicketServlet's url-pattern are both gone !!!

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