This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes Display jsp based on user agent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display jsp based on user agent" Watch "Display jsp based on user agent" New topic

Display jsp based on user agent

Duong Su

Joined: Nov 21, 2009
Posts: 1
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 ?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873


[Asking smart questions] [About Bear] [Books by Bear]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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.
I agree. Here's the link:
subject: Display jsp based on user agent
It's not a secret anymore!