aspose file tools*
The moose likes Struts and the fly likes How to change the default label style in Struts2? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to change the default label style in Struts2?" Watch "How to change the default label style in Struts2?" New topic
Author

How to change the default label style in Struts2?

Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 107
It maybe very simple but I could not find an answer.

I have the following in login.jsp


Struts2 renders the label username and password from a message properties file with default style. How do I change the label style, like change the font or color of "username" and "password"?

I tried <h2><s:textfield key="username"/></h2> or span class="xxx"... but none of them works.

Thanks,
Rich


Thanks,
Rich
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The easiest way is to override the styles provided automagically by S2 (if you're using the <s:head.../> tag) or just create styles for the classnames emitted by the tags.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to change the default label style in Struts2?