You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Todd Orr <to...@gmail.com> on 2007/07/20 17:33:48 UTC

T5 Loading Component Assets

Tap 5.0.5.

I'm having trouble loading an asset from the classpath. Everywhere
I've looked I see that it should be dead simple. However, when I
attempt to view the image directly in the browser (firefox) I get:

The image "http://localhost:8080/testapp/assets/com/test/testapp/web/components/slider_default_selected.png"
cannot be displayed, because it contains errors.


The code that injects the image is:

@Inject
@Path("slider_default_selected.png")
//@Path("context:images/slider_default_selected.png") // testing
private Asset defaultSelectedImage;

...

getter too.


The template code:

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


Has anyone run into this before? For testing the code works fine when
using a context relative injection. However, this is not my ideal
choice for packaging.

Thanks

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


Re: T5 Loading Component Assets

Posted by Todd Orr <to...@gmail.com>.
That seems to be exactly the issue. Thanks a lot!

On 7/25/07, Steven Coco <co...@stevencoco.com> wrote:
> If filtering is enabled in Maven, then it will filter binary files too: and it
> is the case with Maven that your images are nearly guaranteed to be
> corrupted.
>
> The ideal way to solve it is to separate files that need filtering from those
> that don't, by defining several resource directories:
>
> http://maven.apache.org/plugins/maven-resources-plugin/examples/resource-directory.html
>
> You may at first think that this would only collide if the image so happened
> to contain a replacement that exactly matched some available property -- like
> ${version} by coincidence -- however, Maven has the tendency to touch
> seemingly everything in a filtered directory, in a way that causes it to
> differ after the resource phase executes. I don't know exactly what it uses
> for an algorithm there, but my rule of thumb is to 100% strictly separate
> things that do and don't want filtering. (It's likely that Maven simply
> copies, and re-writes every file, using the resources plugin's declared
> encoding; thereby munging any binary file that did not stay intact after
> reading and re-writing in that encoding.)
>
> You are guaranteed to have a problem if you put a binary file into a filtered
> resource directory.
>
> And filtering would be inherited if it were turned on in the parent POM.
>
> On Tue July 24 2007 9:05:12 pm you wrote:
> > I figured out that it has something to do with maven corrupting the
> > image files in the resource directory. I'm trying to pin down the
> > exact problem before blaming maven. However, just by pulling out a
> > parent POM ref in my projects POM everything started to work.
> >
> > On 7/24/07, 小司 <mo...@gmail.com> wrote:
> > > You can read this link
> > > http://tapestry.apache.org/tapestry5/tapestry-core/guide/assets.html
> > > or this link (in chinese)
> > > http://www.javaeye.com/article/78348
> > >
> > > Maybe you can get some idea
> > >
> > > 2007/7/24, Todd Orr <to...@gmail.com>:
> > > > Ugh. I created a small test project and it works correctly there.
> > > > Unfortunately, my real project is much larger. So, now I have the
> > > > incredibly tedious task of starting a new project and adding code bit
> > > > by bit until it breaks so that I can attempt to determine what is
> > > > causing the failure.
> > > >
> > > > On 7/24/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
> > > > > Hi Todd.
> > > > >
> > > > > I just tested this, not with a template, but just writing HTML.
> > > > > Details of my successful test follow, but first ...
> > > > >
> > > > > Are your images under the "resources" tree:
> > > > > \myapp\src\main\resources\jp\co\key_planning\myapp\tapestry\component
> > > > >s
> > > > >
> > > > > That's important, I think.
> > > > >
> > > > > My component CheckBoxImage.java
> > > > >
> > > > > ...
> > > > > @Inject
> > > > > @Path("check_checked.gif")
> > > > > private Asset checkedImage;
> > > > > ...
> > > > > boolean beginRender(MarkupWriter writer)
> > > > > {
> > > > >      writer.element("img", "src", _test ? checkedImage :
> > > > > uncheckedImage); ...
> > > > >
> > > > > Turns out fine in the HTML:
> > > > > <img
> > > > > src="/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check
> > > > >_checked.gif">
> > > > >
> > > > > And I can view the image in the browser at:
> > > > > http://localhost:8080/myapp/assets/jp/co/key_planning/myapp/tapestry/
> > > > >components/check_checked.gif
> > > > >
> > > > > Cheers,
> > > > > Nick.
> > > > >
> > > > > Todd Orr wrote:
> > > > > >> From what I see in the GridColumns code, I've coded this
> > > > > >> correctly.
> > > > > >
> > > > > > I'm still confused about why this works for a core component but
> > > > > > not a custom component. Unless anyone has any insight I'll create a
> > > > > > Jira item.
> > > > > >
> > > > > > On 7/20/07, Todd Orr <to...@gmail.com> wrote:
> > > > > >> Tap 5.0.5.
> > > > > >>
> > > > > >> I'm having trouble loading an asset from the classpath. Everywhere
> > > > > >> I've looked I see that it should be dead simple. However, when I
> > > > > >> attempt to view the image directly in the browser (firefox) I get:
> > > > > >>
> > > > > >> The image
> > > > > >> "http://localhost:8080/testapp/assets/com/test/testapp/web/compone
> > > > > >>nts/slider_default_selected.png"
> > > > > >>
> > > > > >> cannot be displayed, because it contains errors.
> > > > > >>
> > > > > >>
> > > > > >> The code that injects the image is:
> > > > > >>
> > > > > >> @Inject
> > > > > >> @Path("slider_default_selected.png")
> > > > > >> //@Path("context:images/slider_default_selected.png") // testing
> > > > > >> private Asset defaultSelectedImage;
> > > > > >>
> > > > > >> ...
> > > > > >>
> > > > > >> getter too.
> > > > > >>
> > > > > >>
> > > > > >> The template code:
> > > > > >>
> > > > > >> <img src="${defaultSelectedImage}" />
> > > > > >>
> > > > > >>
> > > > > >> Has anyone run into this before? For testing the code works fine
> > > > > >> when using a context relative injection. However, this is not my
> > > > > >> ideal choice for packaging.
> > > > > >>
> > > > > >> Thanks
> > > > > >
> > > > > > -------------------------------------------------------------------
> > > > > >-- To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For
> > > > > > additional commands, e-mail: users-help@tapestry.apache.org
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > > --
> > > 得与失都是生活
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5 Loading Component Assets

Posted by Steven Coco <co...@stevencoco.com>.
If filtering is enabled in Maven, then it will filter binary files too: and it 
is the case with Maven that your images are nearly guaranteed to be 
corrupted.

The ideal way to solve it is to separate files that need filtering from those 
that don't, by defining several resource directories:

http://maven.apache.org/plugins/maven-resources-plugin/examples/resource-directory.html

You may at first think that this would only collide if the image so happened 
to contain a replacement that exactly matched some available property -- like 
${version} by coincidence -- however, Maven has the tendency to touch 
seemingly everything in a filtered directory, in a way that causes it to 
differ after the resource phase executes. I don't know exactly what it uses 
for an algorithm there, but my rule of thumb is to 100% strictly separate 
things that do and don't want filtering. (It's likely that Maven simply 
copies, and re-writes every file, using the resources plugin's declared 
encoding; thereby munging any binary file that did not stay intact after 
reading and re-writing in that encoding.)

You are guaranteed to have a problem if you put a binary file into a filtered 
resource directory.

And filtering would be inherited if it were turned on in the parent POM.

On Tue July 24 2007 9:05:12 pm you wrote:
> I figured out that it has something to do with maven corrupting the
> image files in the resource directory. I'm trying to pin down the
> exact problem before blaming maven. However, just by pulling out a
> parent POM ref in my projects POM everything started to work.
>
> On 7/24/07, 小司 <mo...@gmail.com> wrote:
> > You can read this link
> > http://tapestry.apache.org/tapestry5/tapestry-core/guide/assets.html
> > or this link (in chinese)
> > http://www.javaeye.com/article/78348
> >
> > Maybe you can get some idea
> >
> > 2007/7/24, Todd Orr <to...@gmail.com>:
> > > Ugh. I created a small test project and it works correctly there.
> > > Unfortunately, my real project is much larger. So, now I have the
> > > incredibly tedious task of starting a new project and adding code bit
> > > by bit until it breaks so that I can attempt to determine what is
> > > causing the failure.
> > >
> > > On 7/24/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
> > > > Hi Todd.
> > > >
> > > > I just tested this, not with a template, but just writing HTML.
> > > > Details of my successful test follow, but first ...
> > > >
> > > > Are your images under the "resources" tree:
> > > > \myapp\src\main\resources\jp\co\key_planning\myapp\tapestry\component
> > > >s
> > > >
> > > > That's important, I think.
> > > >
> > > > My component CheckBoxImage.java
> > > >
> > > > ...
> > > > @Inject
> > > > @Path("check_checked.gif")
> > > > private Asset checkedImage;
> > > > ...
> > > > boolean beginRender(MarkupWriter writer)
> > > > {
> > > >      writer.element("img", "src", _test ? checkedImage :
> > > > uncheckedImage); ...
> > > >
> > > > Turns out fine in the HTML:
> > > > <img
> > > > src="/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check
> > > >_checked.gif">
> > > >
> > > > And I can view the image in the browser at:
> > > > http://localhost:8080/myapp/assets/jp/co/key_planning/myapp/tapestry/
> > > >components/check_checked.gif
> > > >
> > > > Cheers,
> > > > Nick.
> > > >
> > > > Todd Orr wrote:
> > > > >> From what I see in the GridColumns code, I've coded this
> > > > >> correctly.
> > > > >
> > > > > I'm still confused about why this works for a core component but
> > > > > not a custom component. Unless anyone has any insight I'll create a
> > > > > Jira item.
> > > > >
> > > > > On 7/20/07, Todd Orr <to...@gmail.com> wrote:
> > > > >> Tap 5.0.5.
> > > > >>
> > > > >> I'm having trouble loading an asset from the classpath. Everywhere
> > > > >> I've looked I see that it should be dead simple. However, when I
> > > > >> attempt to view the image directly in the browser (firefox) I get:
> > > > >>
> > > > >> The image
> > > > >> "http://localhost:8080/testapp/assets/com/test/testapp/web/compone
> > > > >>nts/slider_default_selected.png"
> > > > >>
> > > > >> cannot be displayed, because it contains errors.
> > > > >>
> > > > >>
> > > > >> The code that injects the image is:
> > > > >>
> > > > >> @Inject
> > > > >> @Path("slider_default_selected.png")
> > > > >> //@Path("context:images/slider_default_selected.png") // testing
> > > > >> private Asset defaultSelectedImage;
> > > > >>
> > > > >> ...
> > > > >>
> > > > >> getter too.
> > > > >>
> > > > >>
> > > > >> The template code:
> > > > >>
> > > > >> <img src="${defaultSelectedImage}" />
> > > > >>
> > > > >>
> > > > >> Has anyone run into this before? For testing the code works fine
> > > > >> when using a context relative injection. However, this is not my
> > > > >> ideal choice for packaging.
> > > > >>
> > > > >> Thanks
> > > > >
> > > > > -------------------------------------------------------------------
> > > > >-- To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For
> > > > > additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> > --
> > 得与失都是生活



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


Re: T5 Loading Component Assets

Posted by Todd Orr <to...@gmail.com>.
I figured out that it has something to do with maven corrupting the
image files in the resource directory. I'm trying to pin down the
exact problem before blaming maven. However, just by pulling out a
parent POM ref in my projects POM everything started to work.

On 7/24/07, 小司 <mo...@gmail.com> wrote:
> You can read this link
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/assets.html
> or this link (in chinese)
> http://www.javaeye.com/article/78348
>
> Maybe you can get some idea
>
> 2007/7/24, Todd Orr <to...@gmail.com>:
> > Ugh. I created a small test project and it works correctly there.
> > Unfortunately, my real project is much larger. So, now I have the
> > incredibly tedious task of starting a new project and adding code bit
> > by bit until it breaks so that I can attempt to determine what is
> > causing the failure.
> >
> > On 7/24/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
> > > Hi Todd.
> > >
> > > I just tested this, not with a template, but just writing HTML.
> > > Details of my successful test follow, but first ...
> > >
> > > Are your images under the "resources" tree:
> > > \myapp\src\main\resources\jp\co\key_planning\myapp\tapestry\components
> > >
> > > That's important, I think.
> > >
> > > My component CheckBoxImage.java
> > >
> > > ...
> > > @Inject
> > > @Path("check_checked.gif")
> > > private Asset checkedImage;
> > > ...
> > > boolean beginRender(MarkupWriter writer)
> > > {
> > >      writer.element("img", "src", _test ? checkedImage : uncheckedImage);
> > > ...
> > >
> > > Turns out fine in the HTML:
> > > <img src="/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif">
> > >
> > > And I can view the image in the browser at:
> > > http://localhost:8080/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif
> > >
> > > Cheers,
> > > Nick.
> > >
> > >
> > > Todd Orr wrote:
> > > >> From what I see in the GridColumns code, I've coded this correctly.
> > > > I'm still confused about why this works for a core component but not a
> > > > custom component. Unless anyone has any insight I'll create a Jira
> > > > item.
> > > >
> > > >
> > > > On 7/20/07, Todd Orr <to...@gmail.com> wrote:
> > > >> Tap 5.0.5.
> > > >>
> > > >> I'm having trouble loading an asset from the classpath. Everywhere
> > > >> I've looked I see that it should be dead simple. However, when I
> > > >> attempt to view the image directly in the browser (firefox) I get:
> > > >>
> > > >> The image
> > > >> "http://localhost:8080/testapp/assets/com/test/testapp/web/components/slider_default_selected.png"
> > > >>
> > > >> cannot be displayed, because it contains errors.
> > > >>
> > > >>
> > > >> The code that injects the image is:
> > > >>
> > > >> @Inject
> > > >> @Path("slider_default_selected.png")
> > > >> //@Path("context:images/slider_default_selected.png") // testing
> > > >> private Asset defaultSelectedImage;
> > > >>
> > > >> ...
> > > >>
> > > >> getter too.
> > > >>
> > > >>
> > > >> The template code:
> > > >>
> > > >> <img src="${defaultSelectedImage}" />
> > > >>
> > > >>
> > > >> Has anyone run into this before? For testing the code works fine when
> > > >> using a context relative injection. However, this is not my ideal
> > > >> choice for packaging.
> > > >>
> > > >> Thanks
> > > >>
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> 得与失都是生活
>

Re: T5 Loading Component Assets

Posted by 小司 <mo...@gmail.com>.
You can read this link
http://tapestry.apache.org/tapestry5/tapestry-core/guide/assets.html
or this link (in chinese)
http://www.javaeye.com/article/78348

Maybe you can get some idea

2007/7/24, Todd Orr <to...@gmail.com>:
> Ugh. I created a small test project and it works correctly there.
> Unfortunately, my real project is much larger. So, now I have the
> incredibly tedious task of starting a new project and adding code bit
> by bit until it breaks so that I can attempt to determine what is
> causing the failure.
>
> On 7/24/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
> > Hi Todd.
> >
> > I just tested this, not with a template, but just writing HTML.
> > Details of my successful test follow, but first ...
> >
> > Are your images under the "resources" tree:
> > \myapp\src\main\resources\jp\co\key_planning\myapp\tapestry\components
> >
> > That's important, I think.
> >
> > My component CheckBoxImage.java
> >
> > ...
> > @Inject
> > @Path("check_checked.gif")
> > private Asset checkedImage;
> > ...
> > boolean beginRender(MarkupWriter writer)
> > {
> >      writer.element("img", "src", _test ? checkedImage : uncheckedImage);
> > ...
> >
> > Turns out fine in the HTML:
> > <img src="/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif">
> >
> > And I can view the image in the browser at:
> > http://localhost:8080/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif
> >
> > Cheers,
> > Nick.
> >
> >
> > Todd Orr wrote:
> > >> From what I see in the GridColumns code, I've coded this correctly.
> > > I'm still confused about why this works for a core component but not a
> > > custom component. Unless anyone has any insight I'll create a Jira
> > > item.
> > >
> > >
> > > On 7/20/07, Todd Orr <to...@gmail.com> wrote:
> > >> Tap 5.0.5.
> > >>
> > >> I'm having trouble loading an asset from the classpath. Everywhere
> > >> I've looked I see that it should be dead simple. However, when I
> > >> attempt to view the image directly in the browser (firefox) I get:
> > >>
> > >> The image
> > >> "http://localhost:8080/testapp/assets/com/test/testapp/web/components/slider_default_selected.png"
> > >>
> > >> cannot be displayed, because it contains errors.
> > >>
> > >>
> > >> The code that injects the image is:
> > >>
> > >> @Inject
> > >> @Path("slider_default_selected.png")
> > >> //@Path("context:images/slider_default_selected.png") // testing
> > >> private Asset defaultSelectedImage;
> > >>
> > >> ...
> > >>
> > >> getter too.
> > >>
> > >>
> > >> The template code:
> > >>
> > >> <img src="${defaultSelectedImage}" />
> > >>
> > >>
> > >> Has anyone run into this before? For testing the code works fine when
> > >> using a context relative injection. However, this is not my ideal
> > >> choice for packaging.
> > >>
> > >> Thanks
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
得与失都是生活

Re: T5 Loading Component Assets

Posted by Todd Orr <to...@gmail.com>.
Ugh. I created a small test project and it works correctly there.
Unfortunately, my real project is much larger. So, now I have the
incredibly tedious task of starting a new project and adding code bit
by bit until it breaks so that I can attempt to determine what is
causing the failure.

On 7/24/07, Nick Westgate <ni...@key-planning.co.jp> wrote:
> Hi Todd.
>
> I just tested this, not with a template, but just writing HTML.
> Details of my successful test follow, but first ...
>
> Are your images under the "resources" tree:
> \myapp\src\main\resources\jp\co\key_planning\myapp\tapestry\components
>
> That's important, I think.
>
> My component CheckBoxImage.java
>
> ...
> @Inject
> @Path("check_checked.gif")
> private Asset checkedImage;
> ...
> boolean beginRender(MarkupWriter writer)
> {
>      writer.element("img", "src", _test ? checkedImage : uncheckedImage);
> ...
>
> Turns out fine in the HTML:
> <img src="/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif">
>
> And I can view the image in the browser at:
> http://localhost:8080/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif
>
> Cheers,
> Nick.
>
>
> Todd Orr wrote:
> >> From what I see in the GridColumns code, I've coded this correctly.
> > I'm still confused about why this works for a core component but not a
> > custom component. Unless anyone has any insight I'll create a Jira
> > item.
> >
> >
> > On 7/20/07, Todd Orr <to...@gmail.com> wrote:
> >> Tap 5.0.5.
> >>
> >> I'm having trouble loading an asset from the classpath. Everywhere
> >> I've looked I see that it should be dead simple. However, when I
> >> attempt to view the image directly in the browser (firefox) I get:
> >>
> >> The image
> >> "http://localhost:8080/testapp/assets/com/test/testapp/web/components/slider_default_selected.png"
> >>
> >> cannot be displayed, because it contains errors.
> >>
> >>
> >> The code that injects the image is:
> >>
> >> @Inject
> >> @Path("slider_default_selected.png")
> >> //@Path("context:images/slider_default_selected.png") // testing
> >> private Asset defaultSelectedImage;
> >>
> >> ...
> >>
> >> getter too.
> >>
> >>
> >> The template code:
> >>
> >> <img src="${defaultSelectedImage}" />
> >>
> >>
> >> Has anyone run into this before? For testing the code works fine when
> >> using a context relative injection. However, this is not my ideal
> >> choice for packaging.
> >>
> >> Thanks
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: T5 Loading Component Assets

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Hi Todd.

I just tested this, not with a template, but just writing HTML.
Details of my successful test follow, but first ...

Are your images under the "resources" tree:
\myapp\src\main\resources\jp\co\key_planning\myapp\tapestry\components

That's important, I think.

My component CheckBoxImage.java

...
@Inject
@Path("check_checked.gif")
private Asset checkedImage;
...
boolean beginRender(MarkupWriter writer)
{
     writer.element("img", "src", _test ? checkedImage : uncheckedImage);
...

Turns out fine in the HTML:
<img src="/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif">

And I can view the image in the browser at:
http://localhost:8080/myapp/assets/jp/co/key_planning/myapp/tapestry/components/check_checked.gif

Cheers,
Nick.


Todd Orr wrote:
>> From what I see in the GridColumns code, I've coded this correctly.
> I'm still confused about why this works for a core component but not a
> custom component. Unless anyone has any insight I'll create a Jira
> item.
> 
> 
> On 7/20/07, Todd Orr <to...@gmail.com> wrote:
>> Tap 5.0.5.
>>
>> I'm having trouble loading an asset from the classpath. Everywhere
>> I've looked I see that it should be dead simple. However, when I
>> attempt to view the image directly in the browser (firefox) I get:
>>
>> The image 
>> "http://localhost:8080/testapp/assets/com/test/testapp/web/components/slider_default_selected.png" 
>>
>> cannot be displayed, because it contains errors.
>>
>>
>> The code that injects the image is:
>>
>> @Inject
>> @Path("slider_default_selected.png")
>> //@Path("context:images/slider_default_selected.png") // testing
>> private Asset defaultSelectedImage;
>>
>> ...
>>
>> getter too.
>>
>>
>> The template code:
>>
>> <img src="${defaultSelectedImage}" />
>>
>>
>> Has anyone run into this before? For testing the code works fine when
>> using a context relative injection. However, this is not my ideal
>> choice for packaging.
>>
>> Thanks
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

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


Re: T5 Loading Component Assets

Posted by Todd Orr <to...@gmail.com>.
>From what I see in the GridColumns code, I've coded this correctly.
I'm still confused about why this works for a core component but not a
custom component. Unless anyone has any insight I'll create a Jira
item.


On 7/20/07, Todd Orr <to...@gmail.com> wrote:
> Tap 5.0.5.
>
> I'm having trouble loading an asset from the classpath. Everywhere
> I've looked I see that it should be dead simple. However, when I
> attempt to view the image directly in the browser (firefox) I get:
>
> The image "http://localhost:8080/testapp/assets/com/test/testapp/web/components/slider_default_selected.png"
> cannot be displayed, because it contains errors.
>
>
> The code that injects the image is:
>
> @Inject
> @Path("slider_default_selected.png")
> //@Path("context:images/slider_default_selected.png") // testing
> private Asset defaultSelectedImage;
>
> ...
>
> getter too.
>
>
> The template code:
>
> <img src="${defaultSelectedImage}" />
>
>
> Has anyone run into this before? For testing the code works fine when
> using a context relative injection. However, this is not my ideal
> choice for packaging.
>
> Thanks
>

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