aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60046


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 39535
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.

Ping & DNS - updated with new look and Ping home screen widget
I agree. Here's the link:
subject: Display jsp based on user agent
Similar Threads
(part2)one to one or one to more relationship between use case and sequence diagram??
Jsp Get BrowserType
how to get browser name in a icefaces
conditional text based on user agent