日期:2014-05-17 浏览次数:20878 次
boolean mobileAgent = false;
Header userAgentHeader = request.headers.get("user-agent");
if (userAgentHeader.values.contains("QuhaoAndroid")) {
mobileAgent = true;
logger.debug("The caller agent is mobile : " + mobileAgent);
logger.debug("The caller agent is pc : " + !mobileAgent);
return;
}
if (userAgentHeader.values.contains("QuhaoiPhone")) {
mobileAgent = true;
logger.debug("The caller agent is mobile : " + mobileAgent);
logger.debug("The caller agent is pc : " + !mobileAgent);
return;
}
if (userAgentHeader.values.contains("Windows")) {
mobileAgent = false;
logger.debug("The caller agent is mobile : " + mobileAgent);
logger.debug("The caller agent is pc : " + !mobileAgent);
}
if (!session.contains(Constants.SESSION_USERNAME)) {
logger.debug("no session is found in Constants.SESSION_USERNAME");
renderJapidWith("japidviews.backend.merchant.MerchantManagementController.index");
}
HttpPost request = new HttpPost(httpUrl);
request.setHeader("user-agent", "QuhaoAndroid");