I had to do something almost identical... My solution was to make my CSS file a JSP, and when I referenced that stylesheet in all the other JSP's, I did:

<link rel="StyleSheet" href="/app/styles.act" type="text/css">

where styles.act is actually an ActionMapping. I then had my StylesAction class, just like any other Action, that got some info out of the database and passed it along to the JSP, then I just used all the normal JSP/taglib functionality to dynamically build the CSS content.

Frank

From: Bill Siggelkow <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: How to use dynamically generated  CSS style with Struts tags
Date: Tue, 22 Jun 2004 13:28:47 -0400

Sounds like a custom JSP tag would work pretty well here ...

Voinea, Marina wrote:


Hi everybody, Can you please help with the following question:

What are the possible ways (and best) to modify the style sheet at run time using Struts framework?
Our application is using Struts tags which refer to a static style sheet elements as presented below:


 <html-el:link styleClass="<%=style%>" ....

We need at run time to extract user settings from DB (fonts, colors) and generate a style sheet accordingly .
We could generate the style sheet text file for the user and store it somewhere on the disk and then refer to it, but then we may have too many files (for all active users). There must be a more dynamic and elegant soultion...
Can we use the Struts html:link and pass a String to the "style" attribute of the html:link of the tag ? (It would be good for this string to be extracted from a bean prepared by an action....).


Any example of XSL taglib and Struts tag integration ? This is a very important element for trully dynamic pages ... Any good experience that we can learn from?


Thank you very much, Marina


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
MSN Movies - Trailers, showtimes, DVD's, and the latest news from Hollywood! http://movies.msn.click-url.com/go/onm00200509ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to