Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The following page has been changed by DanielJue: http://wiki.apache.org/tapestry/Tapestry5WhereToStoreExternalResources ------------------------------------------------------------------------------ * In case of CSS/JS/images for components, have a look into the way the T5 Grid or Palette component is constructed, since they have their own js, css and images. [Thanks go to Daniel Jue, who answered my question on June 7, 2007] + + For example, if you have this file: + + src/main/webapp/css/MyStyle.css + + You can access it in your page or component Java class like this: + + {{{ + @Inject + @Path("context:css/MyStyle.css") + private Asset thestyle; + }}} + + And then in your page or component template: + {{{ + <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> + <head> + <title>My Title</title> + <link rel="stylesheet" type="text/css" href="${thestyle}"/> + </head> + ... + </html> + }}} + + Similarly, having + src/main/webapp/css/MyLogo.gif + Page or Component Class: + {{{ + @Inject + @Path("context:images/MyLogo.gif") + private Asset thelogo; + }}} + + Page or Component Template (the html): + {{{ + <img src="${thelogo}" /> + }}} + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
