cancel
Showing results for 
Search instead for 
Did you mean: 

Get User Agent (Browser) in Webdynpro

Former Member
0 Kudos

Hello All,

I'd like to know, what browser is used on the client, in which my WebDynpro application runs. Still there is a different behariour between IE and Fireforx (PC / Mac). So I'd like to give the user a different, but working output.

Wbdynpro does a browser detection. So I suppose, there is a possibility to get this information in my Webdynpro code.

Thanks for help and best regards,

Christian

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Following code may help you to find the browser

HttpServletRequest request = (HttpServletRequest)WDProtocolAdapter.getProtocolAdapter().getRequestObject();

String value = request.getHeader("<Param Name>");

You need to have the depenedency to servlet.jar.

Regards

Ayyapparaj

christiansche
Active Participant
0 Kudos

Hello Ayyapparaj,

thank you for this Idea, but I get a java.lang.ClassCastException on HttpServletRequest request = (HttpServletRequest)WDProtocolAdapter.getProtocolAdapter().getRequestObject();

Additional info: We are on NW04 SP19

Best Regards,

Christian

Edited by: Christian Schebesta on Oct 24, 2008 1:58 PM

christiansche
Active Participant
0 Kudos

Thanks Ayyapparaj,

Through your Idea, I found this Thread:

Now it works by using HttpServletRequest request =((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

Best Regards,

Christian