2009/6/7 Johan Compagner <[email protected]>

> can you debug and see what this returns for both situations?
>
>
> ((WebRequest)RequestCycle.*get*().getRequest()).getHttpServletRequest()
> .getRequestURL().toString()
>


ok , here is my test :

String a1 =
((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getRequestURL().toString();
System.out.println("a1 = " + a1);

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

Link link = new AjaxFallbackLink("link")
{
  @Override
  public void onClick(AjaxRequestTarget target)
  {
    String a2 =
((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getRequestURL().toString();
    System.out.println("a2 = " + a2);

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


a1 = http://foo.bar:8080/app/CurrentPage
s1 = http://foo.bar:8080/app/CurrentPage

a2 = http://foo.bar:8080/app/
s2 = http://CurrentPage/


a1 , s1 are correct ,
a2 , s2 are totally wrong.

Reply via email to