File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How to load themes dynamically? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
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: 261
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: 61761
    
  67

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.)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Simpson Kumar
Ranch Hand

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

Can we add like this ?


if not, pleases explain the following

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
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: 61761
    
  67

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: 261
Thank you for your information, I must investigate the information about the future versions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to load themes dynamically?