If you look at the tag library developer docs
http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/taglib/html/package-summary.html#doc.Other.sessions
you'll see there are three tags, link, rewrite and img. Along with base
these are really useful for creating a context independant site.
The other issue however is session tracking. Sessions are usually managed using cookies but if a client is blocking cookies the only way around this is to include the session in the url. This is where link, rewrite and img come in again. Though in most cases only link will matter. The point is that these tags may choose to append the session id to the end of the url, meaning that you should not append anything to these urls outside of the link, rewrite and img tags.
Either use
<link href="<html:rewrite page="/styles.css" />" rel="stylesheet">
or if you need to set the address with javascript pass a rewritten address to a function with the file you want to set and do string replacement over some marker, eg:
<script>
x = doAReplace('<html:rewrite page="/styles.css" />', 'styles', 'styles_netscape');
document.write('<link href="' + x + '" rel="stylesheet">');
</script>
Where doAReplace() takes the first string, finds the second if it occurs within it and replaces it with the third.
Hope this helps,
James.
Kurt Madel wrote:
<html:rewrite page="" /> will give you the context, so try:
<link href="<html:rewrite page="" />/styles.css" rel="stylesheet">
Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
- getting web app context name in Struts cruegger
- RE: getting web app context name in Struts Karr, David
- RE: getting web app context name in Struts Madel,Kurt
- James Ferguson

