[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Detecting device Type  XML
Forum Index -> Development
Author Message
rchiluano

Power User

Joined: 28/12/2017 07:21:54
Messages: 79
Offline

Hi captain,

Do we have a component or attribute that can determine the size of a browser or determine the type of a device used in accessing the project?

Regards,
Ryan
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi,

by using HttpSessionAccess.getCurrentRequest() you can access the current http request (HttpServletRequest-instance).

There you can access the header attributes of the http-request.

CaptainCasa adds the following attributes in addition to the normal ones:

"eclnt-width" => width of browser
"eclnt-height" => height of browser

Of course the width/height are not really strong indicators for the device type - this refers to the actual browser window, which could be "everything" on desktop systems.

But: the default attribute "User-Agent" should help you much more. It is not totally simple to get some device type out of it... but there are plenty of examples you can copy from StackOverflow! ;-)

Regards, Björn

Björn Müller, CaptainCasa GmbH
rchiluano

Power User

Joined: 28/12/2017 07:21:54
Messages: 79
Offline

Thanks captain!
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team