You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Chiappone <ch...@gmail.com> on 2007/12/05 18:13:38 UTC

T 4.1 Strange Asset Context problem

I have an assets defined in my page spec as follows:

   <asset name="deleteDisImg" path="/images/delete_dis.gif"/>
   <asset name="msi" path="/installer/agent_setup.msi"/>

The images seem to be using the correct context (/esp) as the source output is:

<span>
            <img src="/esp/images/delete.gif" border="0" />
</span>

The msi though comes out like this:

<button type="button"
onclick="window.location='/installer/agent_setup.msi'" id="dlButton">
          Download
 </button>

which does not include the context of /esp

Does anyone know why this may be?

Thanks,

-- 
~chris

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


Re: T 4.1 Strange Asset Context problem

Posted by Matt Brock <br...@gmail.com>.

mistapony wrote:
> 
> Anyone have any idea on this.  It is utterly annoying to have to hard code
> the Context in the page spec.
> 
Well, you don't show how you're using the "msi" asset... You don't normally
see assets included in onlick handlers, so I'm guessing you're using OGNL to
get the value of the path and putting it into an @Any component that renders
the button?  That's... uh, not ideal.

If you're going to do that, you might as well inject the context into your
basepage:


@InjectObject("infrastructure:request")
public abstract WebRequest getRequest();

Then you can use the ognl:request.contextPath instead of hard-coding the
URL.

-- 
View this message in context: http://www.nabble.com/T-4.1-Strange-Asset-Context-problem-tp14176242p14357371.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: T 4.1 Strange Asset Context problem

Posted by Andreas Andreou <an...@gmail.com>.
Can't quite think of anything right now... but tacos-snapshot of 4.1 has an
absoluteAsset binding prefix which makes sure the url that the asset produces
will be an absolute one (assuming that you're looking for a quick workaround)

On Dec 6, 2007 11:57 PM, Chris Chiappone <ch...@gmail.com> wrote:
> Anyone have any idea on this.  It is utterly annoying to have to hard
> code the Context in the page spec.
>
>
> On Dec 5, 2007 10:13 AM, Chris Chiappone <ch...@gmail.com> wrote:
> > I have an assets defined in my page spec as follows:
> >
> >    <asset name="deleteDisImg" path="/images/delete_dis.gif"/>
> >    <asset name="msi" path="/installer/agent_setup.msi"/>
> >
> > The images seem to be using the correct context (/esp) as the source output is:
> >
> > <span>
> >             <img src="/esp/images/delete.gif" border="0" />
> > </span>
> >
> > The msi though comes out like this:
> >
> > <button type="button"
> > onclick="window.location='/installer/agent_setup.msi'" id="dlButton">
> >           Download
> >  </button>
> >
> > which does not include the context of /esp
> >
> > Does anyone know why this may be?
> >
> > Thanks,
> >
> > --
> > ~chris
> >
>
>
>
> --
> ~chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Re: T 4.1 Strange Asset Context problem

Posted by Chris Chiappone <ch...@gmail.com>.
Anyone have any idea on this.  It is utterly annoying to have to hard
code the Context in the page spec.

On Dec 5, 2007 10:13 AM, Chris Chiappone <ch...@gmail.com> wrote:
> I have an assets defined in my page spec as follows:
>
>    <asset name="deleteDisImg" path="/images/delete_dis.gif"/>
>    <asset name="msi" path="/installer/agent_setup.msi"/>
>
> The images seem to be using the correct context (/esp) as the source output is:
>
> <span>
>             <img src="/esp/images/delete.gif" border="0" />
> </span>
>
> The msi though comes out like this:
>
> <button type="button"
> onclick="window.location='/installer/agent_setup.msi'" id="dlButton">
>           Download
>  </button>
>
> which does not include the context of /esp
>
> Does anyone know why this may be?
>
> Thanks,
>
> --
> ~chris
>



-- 
~chris

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