Puttin url parameters into a map

Hi guys,
I have to put all the parameters from a url query string into a map, and I was wondering if anybody knows some library (apache commons, or something like that to do it).
I know it is not hard to do it from scratch, but I want something that I can really rely on.
So, the method would be something like this :
Map getMapFromURL(String url)

Shouldn't be difficult. Split the string on & characters to break it into parameter name/value strings. Split each of those on = characters to break it into name and value. URL-decode the value part. Bung it into the map.
Except... it isn't a rule of URLs that all the parameter names must be different. So you have to decide what to do with this:
value=true&value=false

Similar Messages

  • How to pull URL parameters into my Captivate 6 flash

    I want to be able to parse a parameter being passed in the URL to my Captivate video and then use it after the file is over.   e.g. a username that is picked up by another web page.  Is there an easy way to do this.
    Looking through old posts, is see using the m_MovieHandle as the area to place my flash code, but everything so far I've tried doesn't bring in the variable.   I'm kinda new to flash.
    Thanks

    Put this JavaScript code in a separate .js file.  I called mine utilities.js:
         /* Utility to get a URL Parameters as queryString object */
         var queryString = (function(a) {
              if (a == "") return {};
              var b = {};
              for (var i = 0; i < a.length; ++i)
                   var p=a[i].split('=');
                   if (p.length != 2) continue;
                   b[p[0]] = decodeURIComponent(p[1].replace(/\ /g, " "));
              return b;
         })(window.location.search.substr(1).split('&'));
         /* Utility function to Set a Captivate Variable with a URL Parameter */
          var setCpVariableWithURLParameter = function(cpUserVariableName, urlParameterName){
              /* Get the requested URL Parameter from the URLParams Object */
              var variableValue = queryString[urlParameterName];
              /* Check for HTML5 vs. SWF output */
              if (typeof window.cp==='undefined') {
                   /* We have SWF output, so Get the Captivate Object */
                   var objCp=document.getElementById('Captivate');
                   if(objCp && objCp.cpEISetValue){
                        /* Set the Captivate User variable with the JavaScript variabe, variableValue */
                        objCp.cpEISetValue('m_VarHandle.' + cpUserVariableName, variableValue);
              } else {
                   /* We have HTML5 output */
                   if(cp.vm && cp.vm.setVariableValue){
                      cp.vm.setVariableValue(cpUserVariableName, variableValue);
    Include this .js file in the header of the <ProjectName>.htm file of the swf published output by using a script tag:
    <script src="utilities.js" type="text/javascript"></script>
    Where utilities.js is at the root of the published project (where the published .swf file lives).
    Also add this script tag to the header of the HTML5 output index.html file. 
    To use the setCpVariableWithURLParameter() function, you would make this call inside of a JavaScript action in Captivate:
    setCpVariableWithURLParameter('v_Name', 'userName');
    Where 'v_Name' is the Captivate user Variable you want to set and 'userName' is the name of the URL parameter.
    Give that a try and let us know how it goes.
    Best,
    Jim Leichliter

  • Mapping Issue(UDF) in HTTP-RFC scenario with URL parameters - Urgent

    Hi All,
    I am working out an HTTP-RFC scenarion wherein there is no xml data to be pushed.
    The data will be coming in the url parameters.
    Also we'll exposing our url(created by SAP PI) to 3rd party system to push data in terms of url parameters.
    So how do I do mapping? Also what UDF code will contain?
    Since I'm working on this kind of scenario for the first time, I need every help from you guys.
    Thanks & Regards,
    Amit Patil

    Hi All,
    I have worked on RFC to HTTP scenario wherein URL have to be passed. I used UDF in d same.
    But now the case is reverse, how shall I move ahead with what source message type(in the mapping) and how to do mapping.
    What kind of UDF will be useful here?
    I am completely blank in this kind of scenario where 3rd party system is going to pass four parameters on URL link craeted by us since its an HTTP to RFC scenario.
    Please guys help me! Give me some inputs.
    Thanks,
    Amit Patil

  • How to read URL parameters of one wdp component into other WDP component?

    Dear Experts,
    Can anyone let me know how to read URL parameters of one wdp component into other WDP component?
    My requirement is i have one standard WDP component with 3 URL parameters and i needto
    read that URL parameters along with their values in my Z-WDP component.
    Thanks
    SK

    Hi Santosh,
    You can read parameters send from one WebDynpro Component to another component by adding code in "HANDLEDEFAULT" Event Handler method ( Window )of your target Web Dynpro Component.
    data: lt_parameter             type tihttpnvp,
             ls_parameter             type ihttpnvp.
    lo_api_controller ?= wd_this->wd_get_api( ).
       call method lo_api_controller->get_message_manager
         receiving
           message_manager = lo_message_manager.
       clear : ls_parameter.
       refresh : lt_parameter[].
    * Read all URL parameters
       wdevent->get_data( exporting name = if_wd_application=>all_url_parameters importing value = lt_parameter ).
    if not lt_parameter[] is initial.
         clear : ls_parameter.
         read table lt_parameter into ls_parameter index 1.
         if ls_parameter-name = 'ACTION' and
            ls_parameter-value is initial.
           lv_flag = 'X'.
           clear : lo_msg.
           lo_msg = 'Action Parameter Missing in URL Link !'.
    *         report message
           call method lo_message_manager->report_error_message
             exporting
               message_text = lo_msg.
         else.
         endif.
    Best Regards
    Priyesh Shah

  • Passing parameters into an URL Services portlet

    Hi,
    is there any way to pass parameters into an URL Services portlet ? I want to give the user the ability to set a preference for which sections of an XML file should be displayed. The preference should be passed into the XMLFilter which should add these parameters as XSLT variables to the stylesheet. Is this possible ?
    Cheers,
    Ernst

    As of now we do not have provision to pass parameters to the portlet dynamically. However, if required, at most could be used is headerTrim tag and footerTrim tag. If you want to discard some data from mid of the file, its not supported.
    bye
    Baig
    null

  • Documentation of SAP default BSP url parameters

    Hi,
    I'm looking for a documentation on the SAP default BSP url parameters like
    - sap-syscmd
    - sap-sessioncmd
    - sap-params
    I already used some of them but am not quite sure whether there aren't any more to help me solving tricky problems.
    Is there any list of all parameters including their meaning and examples for usage?
    Thanks & regards
    Wolfgang

    I don't think you have listed the commands for sap-syscmd.  These look like the ones for sap-sessioncmd. 
    The following was taken from page 94 of <i>Advanced BSP Programming</i>:
    <b>SAP-SYSCMD</b>: The only value supported is nocookie.  This tells the BSP runtime to mangle the session ID into the URL and not use a cookie for handling the session id.  This is especially required when the same stateful application must be run multiple times in situations where session ids in coookies would have resulted in all applications mapping ont the same session.
    <b>SAP-SESSIONCMD</b>: The parameter sends actions to the session managemer:
    <b>open</b> - starts a new session
    <b>close</b> or <b>logoff</b> - ends the current application and redirects the browser to the URL supplied by the parameter SAP-EXITURL.
    <b>cancel</b> - is similar to close, but already handled by ICM.
    <b>usr_abort</b> and <b>usr_close</b> - is used by the portal to control BSP sessions. 
    It is interesting that the posting by Guillaume Garcia matches the text from the BSP book exactly.  I referenced my source, did you?

  • Error using XI HTTP adapter specific message attribute URL parameters

    Hi XI gurus, in our XI 7.0 SPS11,
    we have problem using URL parameters of plain HTTP receiver adapter.
    If I set Adapter specific message Properties in communication channel and activate switch for Apply URL parameters (using Parameter 1 to 5) filling them using message mapping, we have no effect; instead we have error "Dynamic Header - Missing Message Attributes: Fields/Parameters".
    We carried out this test:
    1. not using adapter specific message attribute and setting
    a static URL target with fixed parameters it runs correctly.
    2. using adapter specific message attribute for target
    URL and URL parameters both doesn't runs correctly.
    3. using adapter specific message attribute only for target
    URL doesn't run correctly.
    These attribute key used for URL parameters:
    URLParamOne
    URLParamTwo
    URLParamThree
    URLParamFour
    URLParamFive
    Namespace: http://sap.com/xi/XI/System/HTTP
    Can you solve this issue? Are there oss notes, corrections, ...
    Thanks in advance.
    Marco Tricase

    Some other test done with TCP gateway.
    Activated adapter specific message properties for
    *URL
    *HTTP Header fields (one header field named "lisca")
    *URL Parameters (one param named "objectType")
    The HTTP message catched by TCP Gateway
    POST /csl/cslinker HTTP/1.0
    content-type: text/xml; charset=UTF-8
    content-length: 318
    connection: close
    accept: /
    user-agent: SAP Web Application Server (1.0;700)
    host: 10.10.43.94:54000
    accept-encoding: gzip
    <?xml version="1.0" encoding="UTF-8"?>
    seems nothing has been generated, and obviusly URL and params have been set in message mapping.
    Hope some guru has been solved the issue ...
    Pasquale Rossiello

  • Using URL Parameters in a PDF Form

    I built a form in LiveCycle Designer ES and I would like a couple of fields auto populated. The only way I could see doing this without having to purchase the LiveCycle Forms Server or another solution, is to embed the information in the URL.
    I found a blog post about it on Stefan Cameron's blog:  http://forms.stefcameron.com/2006/10/20/using-url-requests-in-pdf-forms/
    I was able to get this to work, but when I try to allow the user to save their form locally, the form information get cleared when they try to reopen it.
    I searched the NET and really couldn't find anything related to my problem.
    Does anyone have an idea about this or should I be looking at a different solution?
    Thanks,
    James

    I think that I was able to resolve this issue myself.  After opening the PDF with URL parameters, you need to manually enter data into a field before saving. After manually entering data in a field and saving, the form contains all of the data.

  • Using URL Parameters with HTTP Comms Channel

    Hi,
    I need to build a new interface (HTTP - RFC) which will use several URL parameters. I've created a HTTP communications channel and Sender Service and this works. I'm able to define several URL Parameters by checking 'Adapter-Sepcific Message Attributes' and then 'Apply URL Parameters' then specifying the individual parameters.
    This is straight forward so far but in usual SAP fashion the documentation on HTTP Comms Channels and URL Parameters is non existent. My question is how do I use these parameters once they are passed. I need to use the values as input parameters for the RFC which means I'll need to map these in the Integration Repository I can't find anything on SDN or SAP help that answers the question.
    I know I could include these values in the XML payload but that would mean my 'customer' would need to amend their application and I'd rather keep things as they are.
    Looking forward to your replies.
    Thanks in advance.

    May be this could help you to refference . .
    For each process template, you can define interactive or composite form reference objects that can optionally be executed at runtime.
    To be able to see and execute the reference object at runtime, you must add an appropriate runtime view.
    Prerequisites
    You can only attach standalone interactive forms to a process. For more information, see Interactive Form Types.
    Activities
    To attach an interactive form to a process:
           1.      Open the gallery and select a process template. To open its design time, choose Open…
           2.      To switch to edit mode, choose  (Edit).
           3.      Open the Forms tab page.
           4.      Choose Add and select the type of reference object you want to add. You can choose between Callable Object and Development Object.
    Browse and select the reference object, and choose Add once again.
           5.      Repeat step 4 to add more objects.
           6.      To define parameter mapping, select an entry and choose Map Parameters. Select a parameter from the left-hand table, and then select the parameter you want to map from the right-hand table. This groups the input parameters of the form reference object to the relevant input parameters of the process.
    If the process does not define input parameters, you can set default values.
           7.      When you have defined the required mappings, choose Done.
           8.      Whenever a newer version of the form reference object is available, its status on the Forms tab page changes to  (Deprecated). To update the object, select it from the list and choose Update. The status changes to  (Active).
    Parameter mapping is preserved unless the parameters of the new object version are different. In this case, you need to define mappings again.
           9.      Finally, choose  (Save).

  • Source of URL parameters when launching the hap_document

    Hi,
    I have been working on the 'Status Overview' iView in the Employee Performance Management module. The source of the table in the iView is the MSS_HAP_STATUS data view in OADP. I have been able to edit and shuffle the columns through the 'define columns' options in the OADP data provider. Some of the columns are shown as links since they are associated with Service Keys which map back to Resources in the homepage framework. The resource 'MSS_MBO_DOCUMENT' is associated with the some of the columns of the Status Overview page. When I click on the link it launches the HAP_Document BSP application with some dynamic URL parameters like
    Application=HAP_DOCUMENT
    PageId=document_portal.htm
    DynamicParameter=NEW_APPRAISER_ID......
    I have been trying to debug the proxy class CL_HRWPC_SER_MBO_PARAMS associated with the service MSS_MBO_DOCUMENT to look for the dynamic URL parameters but didnt find them all in there. I did find some of them but not in the form of the parameter string it generates in the URL.
    Please let me know if I am looking in the right direction. Any help would be really appreciated.
    Regards,
    Prathamesh

    Hi,
    Check SAP note 1505832.
    Thanks
    Sunny

  • How to work with URL parameters?

    Hi,
    I'd like to use URL parameters in my WDA application and then call the application with HTTPS://....?myparam=12345
    and depending on the value of myparam I'd then load some data.
    My first problem is how to declare this parameter. I added an importing parameter "myparam" to the method HANDLEDEFAULT for the DEFAULT starter plug of my window. Is that right? Then I declared this same parameter on tab Parameters of my application and left the value empty.
    The second problem is how to get the parameter value when the application gets called. I pasted HTTPS://....?myparam=12345 into my browser but in the method HANDLEDEFAULT the value of the parameter was initial... What am I doing wrong?
    Any hints are appreciated
    Ira

    Hi Regina,
    >Create the parameters you like as importing parameters >of your startup plug of your window.
    Umm, how? The only way I could add something to the startup plug is to have importing parameters in the method HANDLEDEFAULT. Is that what you mean?
    >Then you have to pass the URL parameter to your >application, otherwise it will dump. BUT you can define >a default value at the application. Go to the property >tab in the application, choose your parameter from the >value list, and set some suitable default value.
    Yes, but my problem is then that the default value of the parameter is always known. I don't know how / where to extract the actual value of the URL parameter. How do I access this value? (and where, which method?)
    Thanks,
    Ira

  • Http receiver adapter - url parameters

    I have a scenario where I'm calling a client proxy and passing a file name to xi.  I have a receiver http adapter configured to post to a servlet.  I want to pass the file name from payload to my query string variable.  i.e PATH = parser/servlet/parsereng and I want to have a url parm like the following:
    ?filename=<filename from payload>
    Any sap documentation walk thru would be great.
    Thanks,
    Mark

    Hi,
    you can set the url dynamically in this was:
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    read:
    which Adapter-Specific Message Attributes you can use on:
    http://help.sap.com/saphelp_nw04/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/frameset.htm
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Reading URL parameters in ABAP webdynpro

    I have a requirements to run my ABAP Webdynpro application view based on two parameters passed to it from portal. How can I read the parameters in ABAP webdynpro and use them to write my condition in the run time. I would appreciate it if someone has any code that would help me also.
    Again your help and support is highly appreciated.
    Lily

    Hi Lily,
    To read the URL parameters, you need to right the following code in the HANDLEDEFAULT method
    of the your default window controller.
    DATA : it_parameter TYPE tihttpnvp,
             wa_parameter  TYPE ihttpnvp.
      DATA lo_nd_url_param TYPE REF TO if_wd_context_node.
      DATA ls_url_param TYPE wd_this->element_url_param.
      " Get all URL parameters
      CALL METHOD wdevent->get_data
        EXPORTING
          name  = if_wd_application=>all_url_parameters
        IMPORTING
          value = it_parameter.
      " Get parameter values
      CLEAR wa_parameter.
      READ TABLE it_parameter WITH KEY name = 'PERNR' INTO wa_parameter.
      IF sy-subrc EQ 0.
        ls_url_param-pernr = wa_parameter-value.
      ENDIF.
      CLEAR wa_parameter.
      READ TABLE it_parameter WITH KEY name = 'SUBTY' INTO wa_parameter.
      IF sy-subrc EQ 0.
        ls_url_param-subty = wa_parameter-value.
      ENDIF.
      CLEAR wa_parameter.
      READ TABLE it_parameter WITH KEY name = 'BEGDA' INTO wa_parameter.
      IF sy-subrc EQ 0.
        ls_url_param-begda = wa_parameter-value.
      ENDIF.
      CLEAR wa_parameter.
      READ TABLE it_parameter WITH KEY name = 'ZZPRNTOPT' INTO wa_parameter.
      IF sy-subrc EQ 0.
        ls_url_param-zzprntopt = wa_parameter-value.
      ENDIF.
      " Save URL parameter to context
      lo_nd_url_param = wd_context->get_child_node( name = wd_this->wdctx_url_param ).
      lo_nd_url_param->set_static_attributes(
         static_attributes = ls_url_param ).
    Regards,
    Vikrant

  • HTTP to RFC scenario with URL parameters

    Hi All,
    I am working on HTTP to RFC scenario using an interface in SAP PI.
    The data will be pushed from API link via 4 URL parameters viz. UID, mobno, phone1, phone2.
    My query is what will be the UDF code for the same.
    Also how to design & configure the same scenario in SAP PI, since I'm working on this scenario for the first time.
    on SAP end, what will be more comfortable to have RFC or Proxy?
    Thanks & Regards,
    Amit S Patil

    Hi All,
    In case of RFC to HTTP scenario wherein we have to pass URL parameters as the request instead of XML/xsd(at the receiver end), there is no need of .xsd file to be imported in SAP PI as target end in request message mapping.
    Similarly in reverse case(HTTP to RFC scenario), if some data will be pushed from external system through URL parameters instead of XML/xsd(at the sender end), how the design & configuration is done in SAP PI?
    Is this reverse scenario possible without any XML/xsd scema at the sender end?
    Please suggest me at the earliest?
    Thanks & Regards,
    Amit S Patil

  • HTTP Post - Capture URL parameters(USER)?

    Hi,
    My scenario is HTTP - XI - ABAP Proxy.
    I wanted to capture USER id of the person who posted(HTTP) into XI(Mapping). <b>How to read/evaluate the value of sap-user from querystring of URL ?</b>
    http://HOST:8008/sap/xi/adapter_plain?namespace=http%3A//abc.com/sales_oa&interface=MI_sales_OA&service=DEV_D&party=&agency=&scheme=&QOS=EO&<b>sap-user=SM9999</b>&sap-password=xxxxx&sap-client=001&sap-language=EN

    Hi Mallik,
    Check the following url’s with reference to Adapter-Specific Message Attributes
    Plain HTTP Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    Configuring the Sender Plain HTTP Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    Configuring the Receiver Plain HTTP Adapter
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    Regards,
    Mike

Maybe you are looking for

  • How can I create a solution with Livecycle

    I work for a high school and we have about 12 pdfs that we need parents to read/scroll through, then 10 (different) pages that we want them to print, complete and return to the school.  Finally, we want them to see a "Thank you, you have done all you

  • Reg. Business Area Determination

    Hi All,              I am getting an error while saving the Sales Order saying "No Businees can be determined" . Please let me know what are all the config. I need to check. Thanks in Advance. Regards, Sen.

  • How I 'fixed' my iTunes 5.0 download...

    I too got some errors whilst installing iTunes 5.0. Windows gave me an error during the download. Well, needless to say, iTunes didn't work anymore. Whenever I tried to uninstall iTunes, the uninstaller wouldn't work completely (again, an error). The

  • Local roll area and Roll area

    Please refer to following contents from TADM12_2: 1. Virtual Memory includes local memory and shared memory. 2. Local memory is associated with individual work processes. 3. Local work processes memory is for: ABAP load; Data, stack; Buffer for datab

  • How to use signed JAR-libs in EAR

    I have a project wich depend library my_crypto, and my_crypto depend JCE. When I place these lib's to WEB-INF - all works fine. But when I remove from WEB-INF/lib my_crypto (I have to do this one!) there is an Exception: java.lang.SecurityException: