aspose file tools*
The moose likes Servlets and the fly likes Pocket PC/Desktop user agents Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Pocket PC/Desktop user agents" Watch "Pocket PC/Desktop user agents" New topic
Author

Pocket PC/Desktop user agents

Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
Hi All,

Just wondering the best approach for redirecting the user to a JSP depending on there user agent.

Up till now, I have a welcome page index.jsp which gets shown regardless, so trying to determine whether to have the default page to be a servlet or a jsp to redirect to either index_pc.jsp or index_ppc.jsp depending on the http_user_agent.

Any thoughts ?
[ April 01, 2006: Message edited by: Bear Bibeault ]

Regards, Dave Brown
SCJP 6 - [url]http://www.dbws.net/[/url] - Check out Grails Forum
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

Personally, I always use a servlet controller to make any decisions. JSPs are units of "view" and by the time you get to one its because you want it to be shown.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
Hi,

Dont you have any type of 'view' as the initial page, not even just a html file ?


I just want to interpret the initial request using http_user_agent and direct the user to a page which is designed for their browser. in my case a desktop version or pocket pc version..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

No, I almost always "hit" a servlet. And always when there's processing to be done, or a decision to be made.

In fact, a decision such as showing completely different pages based on user agent, I will usually handle in a filter.
[ April 01, 2006: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pocket PC/Desktop user agents