cancel
Showing results for 
Search instead for 
Did you mean: 

Why clientInfo object throws NullPointerException.

Former Member
0 Kudos

Hi Friends,

I am tring to implement ClientInfo object to track the browser Information / device Information. Using following Code.

	ClientInfoFactory clientInfoFactory = ClientInfoFactory.newInstance();
	ClientInfo clientInfo = clientInfoFactory.newClientInfo();
	IWDProtocolAdapter protAdapter = WDProtocolAdapter.getProtocolAdapter();
	IWDRequest request = protAdapter.getRequestObject();
	clientInfo.load(request);
	
	String strUseragent = null;
	String strHostname = null;
	
// - This statement throws NullPointerException-
	strUseragent = clientInfo.getUserAgent();         

	strHostname = request.getClientHostName();
	
	wdComponentAPI.getMessageManager().reportSuccess("useragent is "+strUseragent);
	wdComponentAPI.getMessageManager().reportSuccess("hostname is "+strHostname);

The statement which is shown above throws nullPointerException.

I have tested this application in servlets and it works fine there. Kindly help me understanding the probable reasons why this statement fails to execte in webdynpro.

Thanks

Praveen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Armin,

Thank you for reply. If we can not use ClientInfo object then is there any way to track the similar information.

Thanks

Praveen

Former Member
0 Kudos

These are not API classes, so you cannot use them in applications.

Armin

Former Member
0 Kudos

Hello Armin,

So how can you use the clientInfo interface to get browser information, without getting a

NullPointerException?

Thanks in advance