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.
--
Peter Pilgrim | | ++44 (0)207-545-9923
.... \ \ ___ / / ... .
- ---- ( * ) --- --
_____________________________Cafe_Savannah,_San Antonio,Ibiza__
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorized copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.