Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pocket PC/Desktop user agents

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic