on 07-08-2009 9:43 AM
Hello Community,
Some time ago, I already asked this question. Then, we were on NW04. That was the Thread: [Old Thread|;
The solution to retrieve the User-Agent was:
HttpServletRequest request =((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
Now, "IWebContextAdapter" does not work anymore. So I'm in need of another solution. The suggestion of
HttpServletRequest request = (HttpServletRequest)WDProtocolAdapter.getProtocolAdapter().getRequestObject();
String value = request.getHeader("<Param Name>");
in the old thread still throws a "ClassCastException".
I have also found this Thread: [Other Thread|;
But here the suggestion is
HttpServletRequest request = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getProtocolRequest();
String userAgent = request.getHeader("User-Agent");
what doesn't work, because it seems, there is no method "getProtocolRequest()".
I'd be glad, if anyone would suggest a working way of how to retrieve the User Agent in webdynpro NW 7.0 EHP 1 SPS 04.
Thank you very much,
Best regards,
Christian
Hi Christian,
Can you try using this line of code. You can directly get the value of the request object using this.
WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("parameter_name");
// There is getParameterMap() method in which you can know what all parameters are available to be captured.
Map parameterMap = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameterMap();
I hope this helps.
Thanks and Regards,
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.