You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alexey Mukas <al...@gmail.com> on 2013/04/11 21:24:00 UTC

Regresion in 6.7.0-SNAPSHOT

Hi,

I've just checked upcoming 6.7 release and have found a regression (6.6.0
works fine).

The problem appears when I'm trying to use UrlResourceReference with a url
that starts with slash.

Here is the code (assume the case when context path is empty)

@Override
    public void renderHead(IHeaderResponse response) {
        super.renderHead(response);

        UrlResourceReference reference = new
UrlResourceReference(Url.parse(path("style.css")));
        response.render(CssHeaderItem.forReference(reference));
    }

    private static String path(String relativePath) {
        return String.format("%s/%s", getBaseUrl(), relativePath);
    }

    private static String getBaseUrl() {
        return RequestCycle.get().getRequest().getContextPath();
    }

Looks like it was introduced after fixing WICKET-5065

Removing the slash fixes the problem.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Regresion-in-6-7-0-SNAPSHOT-tp4657901.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Regresion in 6.7.0-SNAPSHOT

Posted by Alexey Mukas <al...@gmail.com>.
Done,  WICKET-5141 <https://issues.apache.org/jira/browse/WICKET-5141>  



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Regresion-in-6-7-0-SNAPSHOT-tp4657901p4657913.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Regresion in 6.7.0-SNAPSHOT

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

please create a ticket with a quick start/unit test
On Apr 11, 2013 10:40 PM, "Alexey Mukas" <al...@gmail.com> wrote:

> Hi,
>
> I've just checked upcoming 6.7 release and have found a regression (6.6.0
> works fine).
>
> The problem appears when I'm trying to use UrlResourceReference with a url
> that starts with slash.
>
> Here is the code (assume the case when context path is empty)
>
> @Override
>     public void renderHead(IHeaderResponse response) {
>         super.renderHead(response);
>
>         UrlResourceReference reference = new
> UrlResourceReference(Url.parse(path("style.css")));
>         response.render(CssHeaderItem.forReference(reference));
>     }
>
>     private static String path(String relativePath) {
>         return String.format("%s/%s", getBaseUrl(), relativePath);
>     }
>
>     private static String getBaseUrl() {
>         return RequestCycle.get().getRequest().getContextPath();
>     }
>
> Looks like it was introduced after fixing WICKET-5065
>
> Removing the slash fixes the problem.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Regresion-in-6-7-0-SNAPSHOT-tp4657901.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Regresion in 6.7.0-SNAPSHOT

Posted by Alexey Mukas <al...@gmail.com>.
I've found much simpler solution: use forUrl instead of
forReference+UrlResourceReference
like so
response.render(CssHeaderItem.forUrl("style.css"));

documentation says that the url is context-relative, so it will work with
non-default context as well



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Regresion-in-6-7-0-SNAPSHOT-tp4657901p4657906.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org