aspose file tools
The moose likes JSP and the fly likes How to load themes dynamically? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "How to load themes dynamically?" Watch "How to load themes dynamically?" New topic
Author

How to load themes dynamically?

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
hi ,
In our application we are giving permissions to user to select backgroud themes, 4 themes with different 4 .css files, and in the database we are storing the name of the file, after user created his profile and if he wants to see his profile and checked on view profile, then we need to display the theme as he selected when he registered.

How can we display the background theme? actually our jsp is design according to the .css file and each theme's .css file have the same with different colors, images, etc...

we just gathering the name of .css file from the database and we need to display jsp according to the theme.

Could some one help me about this. if possible send a simple code

thanks,
Sumant K


Thanks,
Kumar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56150
    
  13

Just use JSP mechanisms to generate the right theme CSS file name in the <link> tag.

E.g.


(Assumes that themeName has been set as a scoped variable at some point.)


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
thank you Bear,

Can we add like this ?


if not, pleases explain the following

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
Hey Bear,

My application is working, excellent.

I used the following line


and i put themeFileName in pageContext.

Thank you very mucu Bear
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56150
    
  13

The notation I used, ${themeName}, uses the EL (Expression language), available as of JSP 2.0. It is the modern-day equivalent to your old-fashioned scriptlets. If you are using JSP 2.0, or even plan to continue to use JSP in the future, this is a topic you should investigate very very soon.
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 260
Thank you for your information, I must investigate the information about the future versions.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to load themes dynamically?
 
Similar Threads
Themes for my application
Help with tabbed Panel
am I using MVC correctly?
Help needed in internationalization of J2EE application
how to download files to predefined directory at user's local PC?