"Peter Pilgrim" <[EMAIL PROTECTED]> wrote:
> What is a good way of using Struts and personalisation ?
>
> I would like to write a JavaBean with some personalisation getter and
setter.
> It would probably pick up the details from the database
> I would like to write method to change the background colours of table rows
> for example in a trading application in conjunction with HTML
> Cascading Style Sheet. Suppose I have in my external CSS
>
>
> .tr-apple: { background: #00FF00 }
> .tr-orange: { background: #FF9900 }
> .tr-seablue: { background: #0066CC }
>
> In the my JSP I could have a StyleBean
>
> class StyleBean { ...
> String tr_bgcolor = "tr-apple"; // DEFAULT setting
> String getTableRowBackgroundHTML() {
> return "background=\""+tr_bgcolor+"\" ";
> }
> String setTableRowBackground( String htmlColor ) {
> this.tr_bgcolor = htmlColor;
> }
> ... }
>
> In the JSP it self
>
> <table .... >
> <tr "<bean:write name="styleBean" property="tableRowBackgroundHTML" >"
>
> ...
> <tr>
> </table>
>
> Thoughts on this cheap and nasty __personalisation__ strategy.
Why not use a JSP which returns dynamic CSS?
--
gR