Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display jsp based on user agent

 
Duong Su
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I m trying to display different jsp for each web browser(based on user agent). I want to use different font and format when users view this on firefox, or ie. I try velocity now, but it's not seem to work . Can anyone give me an advice about what simple framework or technical that i can use ?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear's answer is a bit short on details, but the way to go would be to serve particular CSS stylesheets for each browser. So in your JSPs (or whatever templating technology you're using), you'd include separate stylesheets based on the User-Agent request header. If you search for "java user-agent detection" you'll find plenty of code examples on how to do that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic