Externalizing Assets
"Ivanhoe Abrahams" <[email protected]> Mon, 27 Jan 2003 20:11:23 +0200
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi everybody
Yet another question...
I have been trying in vain to start Externalizing my assets, but no
banana....
From what I can see in the docs, all I need to do is
In my servlet's init method
public void init(ServletConfig config) throws ServletException {
Properties props = System.getProperties();
props.put("net.sf.tapestry.asset.dir", "assets");
props.put("net.sf.tapestry.asset.URL", "/assets");
super.init(config);
}
And the test page that I'm trying to get the Assets externalized on
1. the JWC file
<component id="toggleImage" type="Image">
<binding name="image" expression="toggleImageAsset"/>
</component>
.....
.....
.....
<private-asset name="myImageOne" resource-path="&here;/imageOne.gif"/>
<private-asset name="myImageTwo" resource-path="&here;/imageTwo.gif"/>
2. the java file
public IAsset getToggleImage(){
String name = oneActive ? "myImageOne" : "myImageTwo";
return getAsset(name);
}
I am using Tapestry 2.2, JBoss 3/Jetty, Sun Jdk 1.4.1
Thankyou in advance
Ivanhoe Abrahams
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.437 / Virus Database: 245 - Release Date: 2003/01/06
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com