You'll have to read the User-Agent
header from the request and decide on that.
In vanilla servlet apps, a crude way of doing it is:
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
if(request.getHeader("User-Agent").contains("Mobi")) {
//you're in mobile land
} else {
//nope, this is probably a desktop
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…