基于HTTP请求标准的方法来检测在Web应用程序的移动浏览器 [英] Standard way to detect mobile browsers in a web application based on the http request

查看:105
本文介绍了基于HTTP请求标准的方法来检测在Web应用程序的移动浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们都开始往下走的移动浏览器支持的路径为企业电子商务的web应用(基于Java / Servlet的)。当然有要作出许多决定,但它似乎我的基石是能够可靠地检测移动浏览器,并在内容作出决定作相应返回。是否有作出该决定的(快)基于HTTP请求,最好收集有关给定的浏览器和设备发出请求(屏幕尺寸,HTML功能,等等?)的详细信息的标准方式。

We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based). Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the content to be returned accordingly. Is there a standard way to make this determination (quickly) based on the http request, and ideally glean more information about the given browser and device making the request (screen size, html capabilities, etc?).

我也要AP preciate任何补充信息,这将是使用的人谁已经下降的同时从开发方现有的大型企业web应用和建筑师-ING出手机浏览器支持这条道路。

I would also appreciate any supplemental information that would be of use from someone who has gone down this path of taking an existing large scale enterprise webapp and architect-ing out mobile browser support from the development side.

我当然明白请求头和有关标准的用户代理的数据库中的信息是一个很大的帮助。对于那些谈论其他请求头的属性,如果你能包括价值观相似的标准化名称/资源,这将是一个很大的帮助。

[edit] I certainly understand the request header and the information about a database of standard user agents is a great help. For those talking about 'other' request header properties, if you could include similar standardized name / resource of values that would be a big help.

有用户提出,涉及通过线路的一些Web服务,将做检测的呼叫解决方案。虽然我敢肯定,这个工程,它不是一个企业电子商务网站的原因有两个很好的解决方案:1)的速度。在导线每一个页面请求给第三方的调用将有巨大的性能影响。 2)依赖/法律。我们会配合我们的网站的响应时间以及关键功能到他们的服务,这是可怕的法律和风险的原因。

[edit] Several users have proposed solutions that involve a call over the wire to some web service that will do the detection. While I'm sure this works, it is not a good solution for an enterprise e-commerce site for two reasons: 1) speed. A call over the wire for every page request to a third party would have huge performance implications. 2) dependency/legal. We'd tie our website response time and key functionality to their service, which is horrible for legal and risk reasons.

推荐答案

岂不的标准方法是检查用户代理?下面是用户代理的数据库可以用来检测手机浏览器。

Wouldn't the standard way be to check the user agent? Here's a database of user agents you can use to detect mobile browsers.

这篇关于基于HTTP请求标准的方法来检测在Web应用程序的移动浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆