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 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 Android Security Essentials Live Lessons this week in the Android forum!
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: 60810
    
  65

CSS


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

Joined: Mar 22, 2005
Posts: 41155
    
  45
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
 
Similar Threads
Agents
Jsp Get BrowserType
conditional text based on user agent
(part2)one to one or one to more relationship between use case and sequence diagram??
how to get browser name in a icefaces