This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Theme change from struts.properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Theme change from struts.properties" Watch "Theme change from struts.properties" New topic
Author

Theme change from struts.properties

paddy Mahadeva Iyer
Ranch Hand

Joined: Feb 10, 2007
Posts: 63
Hi,

I tried to set my struts 2 theme to simple in "struts.properties" file. But it is not reflecting when the application is deployed. But if i use the theme attribute on my form tag it is working properly. But in that case i am not able to read values from the packages.properties. Are these related issues?

Suggestions for working around this would be highly appreciated.

Thanks in advance
Paddy
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The "simple" theme form tags render *only* the input elements, not associated labels.

If that's what you mean by not being able to read from package.properties then yes, they're related. If you mean that you can't access *anything* from package.properties, then no, it's not related.
paddy Mahadeva Iyer
Ranch Hand

Joined: Feb 10, 2007
Posts: 63
Its the first one! I am not able to read from it.

But that's ok. I have worked around it using "<s:text>" tag.

But the more important concern right now for me is that. I am not able to set the theme from the "struts.properties" file. When I set "ui.theme" to simple, it does not work. It takes the default theme ( i guess xhtml). How can i work around that?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The correct property name is "struts.ui.theme".
paddy Mahadeva Iyer
Ranch Hand

Joined: Feb 10, 2007
Posts: 63
yes i have used "struts.ui.theme" only.

Is there any other configuration necessary?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not that I know of, although the preferred mechanism is to use XML-based constant configuration.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Theme change from struts.properties
 
Similar Threads
use my own image on the knob of a jslider
Configuring FreeMarker(.ftl) with Struts 2
datepicker onChangeTopics to load a div
unable to change default theme in struts2
s:textfield - tdLabel question