You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eddie Man <su...@yahoo.com.hk> on 2005/03/16 04:41:36 UTC

Path of the resources

  Hi all, now I trying to develop a web application using
tapestry, but I have found some difficulties about the
path of the application. I want to using the
dreamweaver to develop the html template, since
tapestry are using the single servlet to work with all
template, so relative path of dreamweaver will not
work anymore.

For example:
Template Login/LoginForm is linked to
"../image/title.jpg".

  Now I need to change all the path after designing
the template, it is really tedious work. So I want to
ask is there have any way to solve this problem? I
looking forward from your reply.

Best Regards,
Eddie Man


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


Re: Path of the resources

Posted by Ron Piterman <mp...@vollbio.de>.
When developing, you will use tapestry components to generate the urls 
(relative or not) for you.

For example:

in DW :

<img src="../images/title.jpg">

in tapestry:

<imag src="../images/title.jpg jwcid="titleImage">

AND (in the .page spec)

<component id="titleImage" type="Image">
	<binding name="image" expression="assets.titleImage">
</component>

<context-asset name="titleImage" path="path-to-image"/>

ציטוט Eddie Man:
>   Hi all, now I trying to develop a web application using
> tapestry, but I have found some difficulties about the
> path of the application. I want to using the
> dreamweaver to develop the html template, since
> tapestry are using the single servlet to work with all
> template, so relative path of dreamweaver will not
> work anymore.
> 
> For example:
> Template Login/LoginForm is linked to
> "../image/title.jpg".
> 
>   Now I need to change all the path after designing
> the template, it is really tedious work. So I want to
> ask is there have any way to solve this problem? I
> looking forward from your reply.
> 
> Best Regards,
> Eddie Man
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


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


Re: Path of the resources

Posted by Kent Tong <ke...@cpttm.org.mo>.
Eddie Man <superman_eddie <at> yahoo.com.hk> writes:

> Template Login/LoginForm is linked to
> "../image/title.jpg".
> 
>   Now I need to change all the path after designing
> the template, it is really tedious work. So I want to
> ask is there have any way to solve this problem?

In your page object, do something like:

void renderComponent(...) {
   String baseUri = 
      getSpecification().getSpecificationLocation().getResourceURL().toString();
   cycle.getRequestContext().getResponse().addHeader("Content-Location", baseUri);
   super.renderComponent(...);
}




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