You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Moritz Gmelin <mo...@gmx.de> on 2010/09/04 20:57:14 UTC

T5.2 update problem - The resource path was not within an aliased path

Hi,

I tried to convert an application from T5.1.0.5 to T5.2. I'm having problems with injected assets.

In the .tml file I have an image like this

<img src="${navleftred}"/>

in the .java file for the page it is stated like this


	@Inject
	@Path("classpath:/assets/icons/nav_left_red.png")
	@Property
	private Asset navleftred;

The file exists and is found (if I change the filename, then I get a file not found exception).

But when I try to access the page, tapestry throws the following error.

Unable to create a client URL for classpath resource assets/icons/nav_left_red.png: The resource path was not within an aliased path.

What does this mean and how can I fix it in T5.2?

Thanks

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


Re: T5.2 update problem - The resource path was not within an aliased path

Posted by Igor Drobiazko <ig...@gmail.com>.
The asset security mechanism introduced in 5.2 requires all assets to be
aliased otherwise they will be rejected. Just provide a contribution to the
ClasspathAssetAliasManager service.

    public static void
contributeClasspathAssetAliasManager(MappedConfiguration<String, String>
configuration){
        configuration.add("icons", "assets/icons");
    }

On Sat, Sep 4, 2010 at 8:57 PM, Moritz Gmelin <mo...@gmx.de> wrote:

> Hi,
>
> I tried to convert an application from T5.1.0.5 to T5.2. I'm having
> problems with injected assets.
>
> In the .tml file I have an image like this
>
> <img src="${navleftred}"/>
>
> in the .java file for the page it is stated like this
>
>
>        @Inject
>        @Path("classpath:/assets/icons/nav_left_red.png")
>        @Property
>        private Asset navleftred;
>
> The file exists and is found (if I change the filename, then I get a file
> not found exception).
>
> But when I try to access the page, tapestry throws the following error.
>
> Unable to create a client URL for classpath resource
> assets/icons/nav_left_red.png: The resource path was not within an aliased
> path.
>
> What does this mean and how can I fix it in T5.2?
>
> Thanks
>
> Moritz
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de