DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Simple theming in Struts 2

Simple theming in Struts 2

Ryan Sukale user avatar by
Ryan Sukale
·
Jun. 14, 11 · Java Zone · Interview
Like (0)
Save
Tweet
6.39K Views

Join the DZone community and get the full member experience.

Join For Free
I was just designing a page in struts. I had already designed the structure of the page using a text editor and also setup the necessary css and javascript for the layout.

But when I introduced a struts tag into the page by replacing the elements with struts tag, somehow the entire layout turned into a huge mess.

Reason? My page contained a form, and struts automatically applies a theme to the form that causes the elements to be rendered in the form of tables. I was like, WTF! When i saw my perfectly looking page utterly distorted coz of no mistake of my own.

If you are facing the same issue, you can simply resolve it by using the simple theme instead of whatever theme struts is using.

In my case, I did the following in my struts form.

<s:form action="my_action" theme="simple">
</s:form>

Yea, that works. Piece of cake. I guess there should be a way to default the theme for the entire project instead of doing it one form at a time, especially since I like to do the styling of the web pages by myslef. Will have to check that.

From http://mycodefixes.blogspot.com/2011/06/simple-theming-in-struts.html

Form (document) Text editor Element JavaScript Database Facing (retail)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 20 Testing Tools and Libraries You Need to Know
  • Composable Architecture
  • Checklist for API Verification
  • Which JVM Version Is the Fastest?

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo