Get User Agent (Browser) in Webdynpro 7.01

Hello Community,
Some time ago, I already asked this question. Then, we were on NW04. That was the Thread: [Old Thread|Get User Agent (Browser) in Webdynpro; 
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|Get User Agent;
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

Similar Messages

  • Getting User-Agent through J2ME Client

    Hi, i think most of the developers here might have come across this problem.
    I have a servlet that will get the client's User-Agent headers value when the client access it. When i access the servlet through a phone browser, the header will give me the phone's user agent. But when i access the same servlet through my J2ME client, the header will return a value of 'UNTRUSTED/1.0' string which doesn't contain any user agent info.
    I understand that in JSR implementation the 'UNTRUSTED' string will be appended to the User Agent header, but the original user agent value is not there. Does anyone knows what is the reason behind this?
    Thanx.
    FooShyn

    first:
    - do not multipost the same message
    second:
    - did you put headers on your connection in your application?
    - and the only useragent that you can get is the useragent defined in the app...
    for example:
    try {
          c = (HttpConnection)Connector.open(url);
          c.setRequestMethod(HttpConnection.GET);
          c.setRequestProperty("IF-Modified-Since", "10 Nov 2000 17:29:12 GMT");
          c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0");
          c.setRequestProperty("Content-Language",      "en-CA");
          os = c.openOutputStream();
    ...taken from http://developers.sun.com/techtopics/mobility/midp/articles/network/ThirdExample.java

  • Using JSP Get User's Default Language

    Hi!
    I have to get the User's Default language using JSP that the client is accessing website and u want to rederict him automatically to his default language which he is using. Like in google aur other websites.
    If it is also possible in Javascript then it is also acceptable for me.

    this can only be done if the request has the Accept-Language header set. You can read this using either request.getHeader("Accept-Language") or request.getHeaders("Accept-Language") for an enumeration of all the languages that the user will accept. Look at this page for details on the Accept-Language header: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Note that the user agent (browser) does not have to provide this information (my Netscape browser does not, and I always get English from Google. My IE browser does, so I will get German if my default lang is set for German).

  • User-agent information

    Hello,
    Do you known, how to get user-agent inoformation with JavaScript about client application? For example about Adobe Reader?
    Thank you very much.

    Better yet:
    xfa.host.appType
    xfa.host.name
    xfa.host.version
    xfa.host... (see previous post)

  • How to get iphones / ipad user agent for internet access

    Hi.
    We recently setup some wireless, and I'm wondering how I can get iphones and ipads connected to the internet without prompting for a username and password. Even if it does prompt and we put in our domain credentials, things don't work.. it's like it heavily restricts access. However if you put DOMAINNAME\ in front of your user name, then it seems to work.
    Without making static IP reservations and attaching those ip's to no authentication in IronPort... isn't there a way to assign these devices to a policy via their user agent string? Problem is finding that string amongst different versions of iphones and ipads.
    I visited www.ipchicken.com on my iphone and it said Browser: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us)
    AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5
    What part of this do I copy into the user agents field for my no autnentication identity that I'm trying to alter? I tried putting AppleWebKit in, but it still blocks almost everything.
    Right now in this Allowed User Agents identiy i have Windows Update checked, as well as these:
    (MSOffice\x2014)
    Microsoft NCSI
    SSLSoapClient
    AppleWebKit (does not seem to work)
    Thanks for the help!

    I think I figured it out.  Followed this closely:
    https://ironport.custhelp.com/cgi-bin/ironport.cfg/php/enduser/std_adp.php?p_faqid=1426&p_sid=ODIeCGuk&p_lva=1713&p_li=cF91c2VyaWQ9MXJvblAwcnQmcF9wYXNzd2Q9Zm8wQmE1
    Also do you guys know if the custom user agent field can accept wildcards?  Problem is, every version of iOS for iPhone 1, 3G, 3GS, 4, and iPad 1 & 2, or ipod touch (various generations) all have variations in their user strings.  If I could just do a blanket statement for like *iphone* , *ipad*, etc.... that would be easier.
    So are there any wildcards or txt masks that can be put in and interpreted in the custom user agents field?

  • Browser user agent

    Hi Guys,
    does anyone know if it's possible to set the browser user agent?
    I want my application to be identified as a mobile device so that I get smaller log in screens on sites that identify by user agent.
    It would be nice to have :)

    D'Oh! You are correct. I was writing that from memory which has just proven itself to be ridiculously flawed!
    I meant this:
    final WebView browser = new WebView();
    final WebEngine webEngine = new WebEngine("http://www.oracle.com");
    Some websites check the user agent to determine if they are smart phones or not and reduce (compact) the size of the display/content for better usability. I thought it might be nice to try to take advantage of that if at all possible.
    I guess it's not possible to set however. Going to http://whatsmyuseragent.com shows some nice information about the JavaFX web client.

  • Trying to get Firefox to open in User Agent "Internet Explorer"

    I run an Internet Cafe and have recently installed Ubuntu 10.04 over Micro$oft.
    I HAVE to give customers an alternative to Live Messenger.
    I have TokBox setup .. but gives problems now & then.
    I need to cover all bases or lose customers.
    The only viable alternative I have found is '''EBuddy'''.
    Now the problem is .. when I log in using Internet Explorer and I connect to a contact - I can see the start video call "button".
    Any other browser and the webcam button does not show.
    All of the Firefox & Seamonkey User Agent Switchers I have tried work .. but I cannot expect the customer to know that they need to switch User Agent before they can use the webcam.
    I need to Launch either Firefox or Seamonkey (preferably Seamonkey - if the fix is to be a permanent one) in Internet Explorer mode.
    A permanent "fix" for Firefox was suggested on the Ubuntu Forum ...
    1. Open about:config
    2. Right-click, choose "New" > "String"
    3. Type "general.useragent.override" (no parentheses) into the "New String Value" dialog box that appears and press "Enter." Type or copy and paste the desired new user agent string into the "Enter String Value" box (in this case "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)" )
    When you're done, copy that Firefox profile to all of your computers (the .mozilla folder)
    I tried this on Seamonkey .. but it did not have the desired effect = no start video call button.
    There is a Proxy Tool add on for Seamonkey which can change the user agent and this works. Same thing for Firefox.
    But the user agent is back to default on browser re-start.
    In an ideal world I would like to create a Launcher on Ubuntu desktop which would open either Firefox or Seamonkey on the E Buddy sign in page and the User Agent would automatically be set to IE8 or 9.

    Try to set the user agent via a user.js file.
    *http://kb.mozillazine.org/user.js_file
    user_pref("general.useragent.override", "<IE user agent>");

  • How to get user browser locale from view object

    Hello,
    Currently, I have a view object that's used to retrieve localized messages from data base. The resource table looks like the following:
    MSG_ID VARCHAR2,  --> specify the L10N resource reference
    LOCALE VARCHAR2, --> used to specify the user locale (browser locale)
    MESSAGE VARCHAR2  --> real message
    I'm creating a bind variable (let's say it 'RequestLocale') in this view object to specify the locale and to get the expected L10N message. Currently, the value for this bind is set as an Expression with value of 'viewObject.DBTransaction.session.locale.toString()'.
    After defining the view object (and the bind variable like above), I created a table by dragging the view object to a jsf page, and run and open the page in a web browser. It seems that the messages (specified by the locale) could be retrieved correctly. But once I change the web browser language settings to another preferred language, and refresh the page, I found that the message is still for the previous locale, and not refreshed to the locale (language/country) that's newly set in web browser.
    Am I supposed to do more thing to get the 'locale' work by using the adf view object bind variable?
    Thanks.

    Hi,
    after changing the locale, can you try a re-direct of the page to see if this changes the locale. In ADF, the locale is set by the HTTP request handler in the ADF lifecycle ensuring that the locale is passed to the middle tier. So the expected change is to come from the view layer (which is why I think you need a redirect). Another option to check is to access the HttpRequestObject from the FacesContext --> External Application to check the request locale
    Frank

  • Creative Cloud User Agent String spoofing old Chrome Browser?

    Was troubleshooting Creative Cloud not working on our network and noticed it is spoofing an old Chrome browser User Agent String.
    When Creative Cloud launches it presents itself as: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.68 Safari/537.22
    This is the user agent string of Google Chrome version 25 (Chrome is currently at version 32)
    Looking for any information on why Creative Cloud is using an old Chrome user agent string, and why can't it use a unique user agent?

    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • How to add iphone user agent in safari browser running on windows xp

    How to add new user agent (iphone user agent) to safari browser(version 3) which is running on windows xp os .
    thanks in advance

    UPDATE:  We were able to further identify the root cause of the problem to be when anonymous access is turned off and the subweb is set up to use basic and integrated authentication (IIS settings).  To test this, we removed integrated authentication (leaving only basic authentication in place) and the problem was fixed.  However, this is not a viable solution as we need to use integrated authentication (for various other reasons).

  • To solve another problem, I need to reset my user agent. But when I type about:config in the address bar, all I get is a Firefox window that has the text "config" on the page and nothing else. No text or fields or ANYTHING. What can i do short of unins

    Firefox 3.6.3
    Windows XP
    Otherwise browses OK.
    == User Agent ==
    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)

    Make sure that you type '''about:config''' in one word and without any spaces in the location bar.
    You can also use "Reset all user preferences to Firefox defaults" on the [[Safe mode]] start window - See http://kb.mozillazine.org/Resetting_preferences

  • Using IE but getting Mozilla/4.0  in user-agent header

    I am using IE but am getting following while printing headers. Why?
    Name: user-agent
    Value: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

    This string is correct. You're using a mozillacompatible (Moz 4.0) useragent IE 6.0 (MSIE 6.0) on Windows XP (NT 5.1). For FireFox it should look like:Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4Maybe you need to read something more about the useragent strings. This has actually nothing to do with Java nor servlets.

  • Browser with spoofed user agent?

    Hi, Does anybody know any -GOOD- mobile internet browser that can allow spoofing the user agent? I hate it when sites redirect to their mobile version based on the user agent of the web browser someone is using.
    I know that Opera Mobile allows spoofing the user agent, but on many websites I am still being redirected to the mobile version.
    I just want the full non-mobile version of the website, FFS.
    Any help is appreciated. Thanks.

    Hm, nevermind, I think I have resolved the issue with Skyfire.

  • User Agent of Adobe Webcapture 9.0? Which browser engine is used?

    What please is the User Agent of Adobe Webcapture 9.0 for Windows, please?
    Which browser engine is Adobe Web capture using if being launched through Adobe Acrobat Pro?
    Your help would be very much appreciated.

    Having same problem using:
    Adobe reader 9.3.2.163
    Windows 7 Home premium Version 6.1.7600, 64bit
    IE 8.0.7600.16385
    Possible solutions found:
    1.  Emailed document to myself from within the reader window (you can enable email button by right clicking on print icon, brings up a menu where clicking on "email" enables the email button on the menu, clicking on that brings up a window where you can send link or copy, send copy spawns an outlook message to yourself with the attachment already filled in, email).  Upon receipt, attachment can be saved (right click, save as).
    2.  Turn of IE protected mode, restart IE, view the pdf, the save icon is now active.  (Your computer is at risk using this option - if you turn it off - you probably should go back and turn protected mode back on again).
    Anyone have any other suggestions?  Just glad to find a work-around ... Would love Adobe to take a look and see if there is a solution to this!

  • Dispite I downloaded app video calling for facebook from appStore, my safari on my MacBook don't work, instead app wants to change browser. If I do this (changing user-agent) what will happen with my safari???

    Dispite I downloaded app video calling for facebook from appStore, my safari on my MacBook don't work, instead app wants to change browser. If I do this (changing user-agent) what will happen with my safari??? I have new (updated 10.7.1) OSX, Lion !!!
    Kind regards!
    Petar

    Dispite I downloaded app video calling for facebook from appStore, my safari on my MacBook don't work, instead app wants to change browser. If I do this (changing user-agent) what will happen with my safari??? I have new (updated 10.7.1) OSX, Lion !!!
    Kind regards!
    Petar

Maybe you are looking for