my dog learned polymorphism*
The moose likes JSP and the fly likes Themes for my application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Themes for my application" Watch "Themes for my application" New topic
Author

Themes for my application

naveen joyce
Greenhorn

Joined: Apr 15, 2011
Posts: 6
Hi all,

I am developing an application in jsp for my client.My requirement is to apply 3 to 4 themes to my entire application.I need to include those themes in a select option so that whenever user selects any one of them that theme has to be applied.Can any one help me with the code in jsp???





Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Use the value of the dropdown to include a different set of css files to apply the different themes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29287
    
140

The major steps I can think of are:
1) Create a CSS file using the same id/class names for each theme.
2) Make sure your JSPs don't have any hard coded formatting info and only use the common id/class names in the theme css files
3) Build a way to let the user change themes.
4) Store the currently selected theme somewhere (maybe in the HttpSession - unless you need to remember it between visits in which case you need to store it in a cookie or the database)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Themes for my application
 
Similar Threads
cant i change LAF at runtime?
Tiles not picking up stylesheet in Spring app
using CSS with j2me
Choosing technology for application: Relational database versus XML Schema.
Web Page calling JSP