This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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?
 
Similar Threads
struts2 properties file reload
Struts2 Validation Not working
How to overwrite the layout of "wwFormTable" in Struts2?
Struts2 newbee - Problem when using form tag
Struts2 Dojo- how to change this form to use "onkeyup"