Retrieve url parameters

Hi All
I need to retrieve all the parameters of the url, for example if the URL looks like
http://www.mydomain.com/MyApp.html#firstName=Nick;lastName=Danger
(example used: http://livedocs.adobe.com/flex/3/html/help.html?content=deep_linking_5.html )
Anyway, the code to extract the parameters looks like
then the parameters are extracted like
        private function init(e:Event):void {
            bm = BrowserManager.getInstance();               
            bm.init("", "Welcome!");
            /* The following code will parse a URL that passes firstName and lastName as
               query string parameters after the "#" sign; for example:
               http://www.mydomain.com/MyApp.html#firstName=Nick&lastName=Danger */
            var o:Object = URLUtil.stringToObject(bm.fragment, "&");               
            fName = o.firstName;
            lName = o.lastName;               
However, the fName and lName remain empty. Any suggestion how to retrieve URL parameters ?
cheers
Luca

Hi scaljeri...try this...it worked for me last week:
protected function readQueryString():String{
          var urlParams:Dictionary = new Dictionary();
          if (ExternalInterface.available)
               var fullUrl:String = ExternalInterface.call('eval', 'document.location.href');
               var paramStr:String = fullUrl.split('?')[1];
               if (paramStr != null)
                    var params:Array = paramStr.split('&');
                    var s:String;
                    for (var i:int=0; i < params.length; i++)
                         var kv:Array = params[i].split('=');
                         urlParams[kv[0]] = kv[1];
                         s =  kv[1];
               return s;
          return null;
yellow

Similar Messages

  • Japanese Characters working as URL parameters, turning to question marks when in URL string itself

    I'm having some trouble getting coldfusion to see japanese
    characters in the URL string.
    To clarify, if I have something like this:
    http://my.domain.com/index.cfm?categorylevel0=Search&categorylevel1=%E3%82%A2%E3%82%B8%E3% 82%A2%E3%83%BB%E3%83%93%E3%82%B8%E3%83%8D%E3%82%B9%E9%96%8B%E7%99%BA
    All of my code works correctly and the server is able to pass
    the japanese characters to the database and retrieve the correct
    data.
    If I have this instead:
    http://my.domain.com/index.cfm/Search/%E3%82%A2%E3%82%B8%E3%82%A2%E3%83%BB%E3%83%93%E3%82% B8%E3%83%8D%E3%82%B9%E9%96%8B%E7%99%BA
    My script (which works fine with English characters) parses
    CGI variables and converts these to the same URL parameters that I
    had in the first URL using a loop and a CFSET url.etc..
    In the first example, looking at the CF debug info shows me
    what I expect to see:
    URL Parameters:
    CATEGORYLEVEL0=Search
    CATEGORYLEVEL1=アジア・ビジネス開発
    In the second example it shows me this:
    URL Parameters:
    CATEGORYLEVEL0=Search
    CATEGORYLEVEL1=???·??????
    Can anyone suggest means for debugging this? I'm not sure if
    this is a CF problem, an IIS problem, a JRUN problem or something
    else altogether that causes it to lose the characters if they are
    in the URL string but NOT as a parameter.

    My suggestion was that you test with the
    first url, not the second. However, I can see a source of
    confusion. I overlooked your delimiter, "/". It should be "?" and
    "=" in this case. With these modifications, we get
    <cfif Len(cgi.query_string) neq 0>
    <cfset i = 1>
    <cfloop list="#cgi.query_string#" delimiters="&"
    index="currentcatname">
    <cfoutput>categorylevel#i# =
    #ListGetAt(currentcatname,2,"=")#</cfoutput><br>
    <cfset i = i + 1>
    </cfloop>
    If it is a failing of Coldfusion, the above test should fail,
    too.
    Now, an adaptation of the same test to your second url.
    <cfset url2 = "
    http://my.domain.com/index.cfm/Search/%E3%82%A2%E3%82%B8%E3%82%A2%E3%83%BB%E3%83%93%E3%82% B8%E3%83%8D%E3%82%B9%E9%96%8B%E7%99%BA">
    <cfset query_str =
    ListGetAt(replacenocase(url2,".cfm/","?"),2,"?")>
    <cfif Len(query_str) neq 0>
    <cfset i = 1>
    <cfloop list="#query_str#" delimiters="/"
    index="currentcatname">
    <cfoutput>categorylevel#i# =
    #currentcatname#</cfoutput><br>
    <cfset i = i + 1>
    </cfloop>

  • Howt to retrieve the parameters sent from an iView in WDA

    Hi,
    I´m sending some parameters form the Portal iView containign the WDA component, how can I retrieve the parameters sent in to my webdynpro ABAP development.
    Kind Regards,
    Gerardo J

    Hi Gerado,
    Go to the window in your WD ABAP component.
    Declare those parameters as importing type in HANDLEDEFAULT method.
    You will receive the values at runtime in these parameters.
    Please check this wiki also. It tells about reading URL parameters in WD ABAP but it will work the same way for iView paramters.
    [http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoreadURLparametersinWebDynproforABAP|http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoreadURLparametersinWebDynproforABAP]
    I hope it helps.
    Regards,
    Sumit

  • Passing URL parameters to WD app in URL IView

    Hi experts,
    I'm using EP 7.2 and as I found out this version doesn't support Web Dynpro Java iview template so I'm using URL iview template for my Web Dynpro Java application. My requirement is to somehow pass some URL parameter (which is id for something in my app) to the WD app in the URL iview. So in this scenario setting the URL parameters and their values during design time for the iview is not suitable. I tried DynamicParameter=id%3D154 for example but it doesn't work. Do someone has any ideas to solve this problem? Any help will be appreciated.
    Regards,
    Martin
    Edited by: musaka on Oct 27, 2009 1:12 PM

    Hi Musaka,
    If i am not mistaken, your requirement is to display a URL iView to user with some parameters (contained within the Address Bar of the Browser) to be passed to the iView. Initially as no parameter value can be defined on previewing the iView or opening the iView, no value is passed to iView. But in case, when you directly enter the Parameter Values against Parameter Names in Address Bar and then say go, the page should reload and pick the parameter values from URL in Address Bar instead.
    Steps to follow:
    1. Put     CustomerId=0&RequestId=0            in the Application Parameter property of the URL iView.
    2. Put the following lines of code in the wdDoInit() in the implementation tab of the View Controller to retrieve and use the passed parameter value in the View of the application and then say Organize Imports from the context menu.
    int customerId = WDProtocolAdapter().getProtocolAdapter().getRequestObject().getParameter("CustomerId");
    int requestId = WDProtocolAdapter().getProtocolAdapter().getRequestObject().getParameter("RequestId");
    Please revert in case of any issue.
    Regards,
    Tushar Sinha,
    Infosys Technologies Limited,
    Hyderabad,
    India
    Edited by: tushar sinha on Oct 29, 2009 10:51 PM

  • Problem with URL parameters& Forms

    First off, this is a school assignment so I am not looking for code, just suggestions. I e-mailed my prof, but she hasn't gotten back to me.
    I have a nim program, that game where you pick matches up till someone picks up the last match wins. I need to change the program so that it accepts a variable integer to change the starting number of matches. I opted to use a form, but this has gotten me into some trouble. My prof. used url parameters to determine who should go first, the human or the computer.
    Basically, I need to submit the variable in order to post the number, but I also need to redirect depending on who goes first.
    This is what she did with the URLS:
        [<a href="<%=root%>/StartServlet?first=computer">Computer</a> (that's me!)]
        [<a href="<%=root%>/StartServlet?first=human">Human</a>]My form is just a simple, standard form at the moment:
        <form name="input" action="<%=firstMover%>" method="post">
            <input type="text" name="matches">
            <input type="submit" value="Submit" name="Submit" />
        </form>Variable Retrieval:
            match= request.getParameter("matches");
            matchCount= Integer.parseInt(match);There is a lot of code associated with this program. So if you need more please just ask.
    Any suggestions are greatly appreciated as I have no idea...

    That might work, but I need to allow the user to choose who goes first, computer or human. I'm not sure if I can do that with a hidden form. (Maybe I am just not seeing it the way you are.) Also, she analyzes whether the person chose computer or human first in the startservlet class. It looks like she parses the URL there and grabs the parameters.
    Your suggestion gave me an idea... but I can't get the program to recognize my variable. I don't think I am sending it to the right place.
    Form:
    <form name="input" action="<%=root%>/StartServlet?" method="post">
            <input type="text" name="matches">
            <select name="firstMove">
                <option value="Computer" checked>Computer</option>
                <option value="Human">Human</option>
            </select>
            <input type="submit" value="Submit" name="Submit" />
        </form>    My request of parameters:
    public class StartServlet extends HttpServlet {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
        * @param request servlet request
        * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            String match= request.getParameter("matches");
            int matchCount= Integer.parseInt(match);
            Nim nim = new Nim(matchCount);
            HttpSession session = request.getSession();
            session.setAttribute("nim", nim);
            String first=request.getParameter("firstMove");
            if ("computer".equals(first)) {
                try {
                    nim.machinePlay();
                } catch(NimException e) {}
            }

  • Live view doesn't correctly pass URL parameters from HTML docs?

    Running into something that I wonder if anyone else has seen.  I've created a site in DW CS5 with a local testing server (XAMPP on Win7), and if I use LiveView to view an HTML page that has a link to a PHP page that includes a URL parameter, the parameter shows up in the LiveView address bar, but the page doesn't seem to use it (trying to display an image where the file is built using $_GET to retrieve the parameter).  The same HTML page, displayed in a browser, works.  And if I then save the HTML page as a PHP page in DW, identical code, LiveView works.  Sure looks like LiveView will does not properly handle URL parameters from HTML documents...

    Sorry if I wasn't clear... the navigation works correctly; I get to the page I'm tyring to get to.  One of the things that page should do is display an image, the I use a URL parameter to build the image file name to retrieve.  The link in the first page is something like <a href="gallery.php?pg=1">.  Works fine if the first page (the one I'm navigating from) is a PHP page, doesn't work (with the same code which is only HTML) if the page is an HTML page.

  • Can I access URL parameters?

    Is it possible to access URL parameters from a WebStart application?
    Example:
    http://www.domain.com/example.jnlp?parameter1=43
    I would like to initialize my JWS app using the information given to me in parameter1.
    Is this possible? I believe that this would be very powerful.
    Thanks.

    If your www.domain.com/example.jnlp is a CGI script or servlet that returns a .jnlp file with
      <application-desc>
        <argument>43</argument>
    </application-desc>and you retrieve that parameter from args[1], it might work.
    Regards,
    Marc

  • Fiori - URL parameters

    Hi,
    We are currently using CRM Fiori My Opportunities.
    We want to enhance the application using the Fiori extension toolkit to default values in the create screen.
    In the SAP project, I see that the route is defined as:
    "create"  :  {
                    "pattern" : "create/{contextPath}/{processType}",
                    "view"  : "S5"
    This route is defined in the Component.js file, and currently it is not possible to redefine with the toolkit. So I'm stuck with the route as it is.
    Given this route, I expect that when the URL contains create/abc/cde then it should indeed load S5 view and S5 controller.
    https://host:port/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?#ZOpportunity-Manage/create/abc/cde
    https://host:port/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?#ZOpportunity-Manage/create/abc/cde?CustomId=1234
    So I tried redefined the S5 controller onInit to retrieve the URL parameters.
    Questions:
    1) Where should I put the URL parameter? Before the intent or after?
    2) How do i retreive this from the onInit method?
    Cheers
    Michael.

    Hi Tejas
    i got it & understood.
    New Query
    very close to finish
    1) i have done all configuration as per you suggested.
    i  used    this URL  /sap/bc/ui5_ui5/sap/ui5_mm_po_apv/index.html?sap-client=300
    i am getting below screen that screen continueslly loading not stop & not a data show.
    2) Catelogs Screen below
           *) What should i do with SAP Lumira ?
    3)
    4 ) I have created on PO .
    5)
    what should i enter when i create New PO ?
    6)  by using this URL /sap/opu/odata/UI2/PAGE_BUILDER_CUST/Catalogs
    i am getting the list of all Catalogs
    Catalogs('X-SAP-UI2-CATALOGPAGE%3A%2FUI2%2FSAP_LUMIRA_TC')
    Catalogs('X-SAP-UI2-CATALOGPAGE%3ASAP_APP002_MM_PO_APR')
    Catalogs('APP002_MM_PO_APR')
    Catalogs('SRA017_SD_SO_CR')
    Catalogs('HCM003_HCM_LVRQ_APR')
    Catalogs('PO_APPROVAL')
    Catalogs('SAP_MM_PO_APV_APP')
    Catalogs('SAP_MM_PR_APV_APP')
    Catalogs('%2FUI2%2FLAUNCH_PAGE')
    Catalogs('APP001_MM_PR_APR')
    7)
    Below screen Scenario Identifier. where i assign Standard Task
    8) i used PFTC t-code
    TS 30000016   screen short
    please guide me. what kind of steps must follow to create Standard Task
    below screen short is a Purchase Requisition.
    i gave you all details so you can help me. where is the problem. how to resolve that problem ?
    still data not getting. i also attached Purchase Requisition screen short.

  • How to parse crystal report query prompt value via url parameters

    HI All,
    I am creating a employee detail report in crystal report. The recordset is huge and i have created a parameter prompts in the query and thinking to parse the prompt value via url parameters. Not sure why i still could not make it works.
    for example, in my query panel i have created a prompt called "pwwid"
    and this is how i parse the prompt value via open document url.
    OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AV8U6HlIq4FBl_MhcBwHqGI&lsSpwwid=12345678
    I read the sap documentation, this is how it parse the prompt value via url parameter. but it is not working for me and i am getting prompt to fill in the wwid whenever i run the reports.
    any idea why i am not getting this works?
    Regards,
    KeatAun

    Could you try:
    OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AV8U6HlIq4FBl_MhcBwHqGI&lsSpspwwid=12345678
    -Abhilash

  • The Web Dynpro application was called up with the wrong URL parameters

    Hi all,
    I am using the systems below:
    ERP STACK :16
    EHP : 4
    EHP SP Stack :4
    EA-HR * : 604(SP12)
    SAP-HR * :604(SP12)
    XSS JAVA components : SAP ESS 603 SP05
    SAP MSS 600 SP16
    PCUI_GP 603 SP05
    Business Package : BP ERP05 ESS 1.41 SP04
    BP ERP05 MSS 1.41 SP04
    BP ERP05 COMMON PARTS 1.41 SP04
    I am getting below error after clicking on the appraisal document:
    App. Called Up Incorrectly
    The Web Dynpro application was called up with the wrong URL parameters.
    Note
    Enter the URL parameters and their use.
    You can find more information on the functions that you can perform in the catalog for appraisal templates in the Implementation Guide (IMG) for Objective Setting and Appraisals under Edit Forms.
    I already applied the below notes also:
    1468466 Performance Management Launchpad Configuration
    1463821 Performance Management Portal Configuration
    1416756 OBN Configuration in Performance Management
    1408243 Configuration for object-based navigation
    Plz advise me??
    Thanks,
    Anumit

    can you paste the exact error. also you can take a HTTP trace and see which resourse or UWL is being launched!

  • 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

  • Migration Report from SQL 2008 R2 SharePoint Integration to SQL 2012 SharePoint Integration - Url Parameters (ReportViewer)

    Dear All,
    I have issues in Url Parameters in SharePoint Integrated Mode (Reporting in SQL Server 2012).
    Test Server - Working fine
    with URL Parameter
    1. SharePoint 2010 + SQL Server 2008 R2 Reporting - SharePoint Integration Mode
    2. I have 1 PageView Web Part to call a Reports. Eg:-
    http://myserver_Test/ReportServer/Pages/ReportViewer.aspx?http://myserver_Test/SSRS%20Reports/Report_1.rdl
    Production Server - Failed
    with URL Parameter
    1. SharePoint 2010 + SQL Server 2012 Reporting - SharePoint Integration Mode
    2. Same a Test Server, I have a PageView Web Part to call a Reports but failed with page not found. Eg:-
    http://myserver_Production/ReportServer/Pages/ReportViewer.aspx?http://myserver_Production/SSRS%20Reports/Report_1.rdl
    I have check the Reporting folder (C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\WebServices\Reporting) and can't found any web page as
    ReportViewer.aspx.
    Thanks

    Dear All,
    Did anyone know, how can I Use the HTML Viewer in SharePoint Integrated Mode for SQL Server 2012 Reporting.
    I'm able to user the HTML Viewer in SharePoint Integrated Mode with the Reporting is SQL Server 2008 R2.
    http://techpunch.wordpress.com/2008/09/17/sql-server-reporting-services-url-parameters-in-sharepoint-integrated-mode/
    I know there is possible to call a report with RSViewerPage, but my users are
    not happen with the UI of default SharePoint reports display (RSViewerPage).
    http://msdn.microsoft.com/en-us/library/a58b4ca6-129d-45e9-95c7-e9169fe5bba4(v=sql.110)
    Appreaciate you help.
    Thanks

  • How to read URL Parameters in ABAP WebDynpro ?

    Hi,
    How and where (which class, method) in ABAP WebDynpro we can read URL Parameters ? I found answers for WebDynpro JAVA but nothing for ABAP.
    Thanks
    Meenal

    Hi Meenal,
    Please see a post by Sanjay Agarwal titled 'Sequencing Problem in Web Dynpro ABAP'. I believe you will find your answer there.
    Cheers,
    Rich

  • Displaying the URL parameters in pdf file.

    Hello, I need help about using JavaScript with pdf file. I have an URL like this: http://www.a.org/mta/sigtr_mta.pdf?&rqst_id=8762312&inst=The+Jackson+Laboratory&pi=Dr.PI& 022008-UCD. Is there a way that I can extract the URL parameters (such as rqst_id or inst ) from JavaScript in this pdf and replace some form text field with the parameters and set these fields to read only.
    I appreciate any of your help or hint!

    this.URI(), I believe, will get you the complete URI that the document was opened from. Then you can parse it any way you'd like.
    Leonard

  • 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.

Maybe you are looking for

  • NOKIA N70. IS THIS EVEN POSSIBLE???

    NOKIA N70 - DIALLING ITSELF Could you please advise me on this issue to clear it up with my mobile phone provider. For the last two years I have been using this phone with a prepaid card, without any problem. From 6th April 2010 I took a phone plan w

  • The computer has rebooted from a bugcheck

    Dear all,  One of our server is rebooting and giving these 2 errors. Kindly help on how to fix it.  Event ID: 1001 Level: Error Source: BugCheck The computer has rebooted from a bugcheck.  The bugcheck was: 0x0000003b (0xffffffff80000002, 0xe00001065

  • Storing audio file in SQL Server

    Hi All, I need to store the recorded .wav file into the SQL Server. Can anyone give me the code that achieves this functionality. Thanks in Advance

  • What connection should I use for the Change Management feature?

    I'm trying to evaluate the Change Management feature in SQL Developer 3.2.20.09 (Build MAIN-09.87), but whichever connection I use I get an error: "This is not a valid Enterprise Manager connection." I can connect to Enterprise Manager in my browser

  • Abap-alv grand totals

    hi friends, how to find alv grand totals with out subtotals.   for ex for subtotals we use do_sum, like that what we use for grand totals with out subtotals.