This is my code snipet:
Code: Select all
public void Device getDevice(HttpServletRequest request, ServletContext appContext){
WURFLHolder wurflHolder = (WURFLHolder) servletContext.getAttribute(WURFLClass);
System.out.println("WURFLHolder Class Name:"+wurflHolder.getClass().getName());
wurflManager = wurflHolder.getWURFLManager();
System.out.println(" Before creating Device, the Request's UserAgent ======>"+httpServletRequest.getHeader("user-agent"));
Device device = wurflManager.getDeviceForRequest(httpServletRequest);
System.out.println(" After Creating Device, the UserAgent became =======>"+device.getUserAgent());
return device;
}
Code: Select all
WURFLHolder Class Name:net.sourceforge.wurfl.core.web.ServletContextWURFLHolder
Before creating Device, the Request's UserAgent ======>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
After Creating Device, the UserAgent became=======>DO_NOT_MATCH_GENERIC_WEB_BROWSER
My question is how come 'userAgent' of HttpServletRequest change to other UserAgent i.e. 'DO_NOT_MATCH_GENERIC_WEB_BROWSER' and set to Device object?
Is there any rule within WURFL engine/core that consult wurlfl.xml and change it?
Please please help me on this. What is the logic behind this.
regards
SKC