I have this in my Border component:
<script jwcid="@Any" type="text/javascript" src="ognl:baseURL +
'/js/dojo/dojo.js'"></script>
And in the java file:
@InjectObject("infrastructure:request")
public abstract WebRequest getWebRequest();
public String getBaseURL() {
return getWebRequest().getContextPath();
}
Hope it helps ;).
--
Ing. Leonardo Quijano Vincenzi
DTQ Software
Paul Cantrell wrote:
I'm trying to use Tacos, and have run into the problem of including dojo.
Tacos recommends I include dojo like this:
<script type="text/javascript" src="js/dojo/dojo.js"></script>
The trick is that my pages have a custom URL structure involving
slashes, so that the path for a page might look like this:
/myapp/article/6738
...and instead of looking in /myapp/js/dojo/dojo.js, the browser tries
to load the script from /myapp/article/js/dojo/dojo.js!
Of course, I can hard-code the correct full path in my JS include,
with the initial slash, but that's an awful hack -- there's no reason
to think that my app will always be deployed as "myapp".
I don't want to use the Script component (I think...), because it
would actually inline the whole massive dojo script in my page, and I
only want clients to have to download it once -- plus, it would only
push the include path problem back one level, without actually solving
it.
Would it work to include the script as an asset, and let Tapestry
build the correct path for me? If so, how would I do that?
Should I just write my own ScriptAsset component...?
Or is there some other solution to this problem?
Cheers,
Paul
_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Ing. Leonardo Quijano Vincenzi
DTQ Software
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]