How to redirect to different JSP view based on client device in Portal server
Deepak Gupta_ISL 060001TG9W Visits (9974)
Problem Scenario is :
IBM Web Sphere Portal provides support to all modern devices including mobile, laptop,desktop, tablet etc, so users wants to determine the client in order to know its capabilities and respond accordingly. For each incoming request users wants to know the the client that issued the request for eg. they wants to know if request is coming from mobile or tablet etc.
Solution is: Use "Client Profile Information CC/PP" - Standard API for accessing client profiles. The Portal uses JSR 188 specification and it allows portlets to access the client through a request attribute.
DeviceClass, Vendor, BrowserName, BrowserVersion are few attributes of client profile.
Following sample code determines if the request is coming from tablet or smartphone or desktop and forward the JSP view accordingly.
Summary: Client Profile Information CC/PP standard API allows portlets to access client details through a request attribute.