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
JavaRanch » Java Forums » Java » JSP
Bookmark "Display jsp based on user agent" Watch "Display jsp based on user agent" New topic
Author

Display jsp based on user agent

Duong Su
Greenhorn

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 ?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61233
    
  66

CSS


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

Joined: Mar 22, 2005
Posts: 41900
    
  63
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 - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display jsp based on user agent