How to get the URL of the request.

I am trying to get the URL from where the request is coming to the servlet. If http://www.xx.com/ calls my servlet i want to know that the request is coming from http://www.xx.com/ URL. If i use request.getRequestURL() which is displaying my servlet URL. Please help me which is very urgent.

You actually want the referrer? You can obtain it from the request headers as follows:String referrer = request.getHeader("referer"); // Yes, with the legendaric misspelling in there.Having said that, be aware that the client has full control over what he sends with the request headers. So the client can change/spoof/remove the referrer entry to his taste anytime. Your code should not rely that much on it, it should rather be used for statistics only.

Similar Messages

  • How to get the request scope values?

    Hi,
    I have one question about Struts validate framework question is How can i get the request scope values when the validate method throws an exception?
    My scenario is I have some values in the request scope in one page. After submitting the page the validate method throws an exception, then the errors were displayed in the page and it ask for provide correct information. However, at this time the values in the first request will become null. How can I get those request values?
    Request.setAttribute(�con�, conn);Link after click this link user will display with user reg. form with user details input fields. After submitting he user details form if user provide some invalid information then validate method in Action form will throw errors and displayed the User details form with errors. However, the request attribute �con� will become null at this point of time. How can I get the user request attribute in user details form?
    Assume request have more than 100 values.
    Waiting for answer...
    Regards,
    Bhaskar Reddy

    Your code is probably fine, and you are probably running into http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6497210
    See also http://forum.java.sun.com/thread.jspa?messageID=9419890
    SUN needs to fix a few bugs for this to work...

  • How to get the request in a SearchComponent

    Hello,
    I developed a search component and want to implement a language specific logic.
    Therefore I tried to get the component request to get the user to get the users language.
    But unfortunatly I'm not able to get the request. In a normal AbstractPortalComponent there's no problem to get the request, but my interface ISearchComponent, which I have to use, does not provide any kind of request...
    Please help,
    Regards,
    Axel

    Hi Axel,
    Did you just implement an ISearchComponent interface? If yes, then you have implemented setDynPage(dynPage) which is called by the framework passing a DynPage object. On that you can call getRequest(). See http://media.sdn.sap.com/html/submitted_docs/nw_kmc/javadoc/com/sapportals/wcm/control/util/search/ISearchComponent.html and https://media.sdn.sap.com/javadocs/NW04/SPS15/hb/com/sapportals/htmlb/page/DynPage.html for details.
    If the answer to the initial question is "no", please provide details which class you may have extended etc.
    Hope it helps
    Detlev

  • How to get the request xml string in Business service.

    Hi
    I have following requirement
    1) XAI inbound service will get a input xml request feed and call the Business Service.
    2) Business service will do some validation and do the insert in the database.
    My BS schema is as below
    <schema pageAction="change">
    <personId mapField="PER_ID"/>
    <personOrBusiness mapField="PER_OR_BUS_FLG"/>
    <name mapField="ENTITY_NAME" mdField="C1_ENTITY_NAME"/>
    <emailAddress mapField="EMAILID"/>
    <city mapField="CITY"/>
    <county mapField="COUNTY"/>
    <postal mapField="POSTAL"/>
    <houseType mapField="HOUSE_TYPE"/>
    <taxVendorGeographicalCode mapField="GEO_CODE"/>
    <isInCityLimit mapField="IN_CITY_LIMIT"/>
    <state mapField="STATE"/>
    <version mapField="VERSION"/>
    <division mapField="CIS_DIVISION"/>
    <accessGroup mapField="ACCESS_GRP_CD"/>
    <address1 mapField="ADDRESS1"/>
    <personCharacteristic type="list" mapList="CI_PER_CHAR">
    <personId mapField="PER_ID"/>
    <characteristicType mapField="CHAR_TYPE_CD"/>
    <characteristicValue mapField="CHAR_VAL"/>
    <effectiveDate mapField="EFFDT"/>
    <adhocCharacteristicValue mapField="ADHOC_CHAR_VAL"/>
    <characteristicValueForeignKey1 mapField="CHAR_VAL_FK1"/>
    <characteristicValueFK2 mapField="CHAR_VAL_FK2"/>
    <characteristicValueFK3 mapField="CHAR_VAL_FK3"/>
    <characteristicValueFk4 mapField="CHAR_VAL_FK4"/>
    <characteristicValueFK5 mapField="CHAR_VAL_FK5"/>
    </personCharacteristic>
    </schema>
    The request XML to BS is as below_
    (support.schema.AbstractSchemaBasedDispatcher) Performing page:change of BusinessService CM_SPRDSHT_BS' (service='CMSPRDHSHTUPLD'), with input request
    <?xml version="1.0" encoding="UTF-8"?>
    <CM_Person>
    <personOrBusiness>P</personOrBusiness>
    <name>Marsh,Corporate</name>
    <emailAddress>[email protected]</emailAddress>
    <city>Tampa</city>
    <country>USA</country>
    <postal>2131</postal>
    <houseType/>
    <taxVendorGeographicalCode/>
    <isInCityLimit/>
    <state>CA</state>
    <version>1</version>
    <division>930</division>
    <accessGroup>***</accessGroup>
    <address1>Address of Khan</address1>
    </CM_Person>
    I can access the values of each xml node in BS with the help of data item.
    I wanted to know how can I get the above request xml string in my Business Service in Java.

    {color:#0000ff}http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
    http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#valueOf(java.lang.String){color}

  • On my iPad, when I try to open a movie I purchased from iTunes, I get "The requested URL was not found on this server."

    On my iPad, when I try to open a movie I purchased from iTunes, I get "The requested URL was not found on this server."  It's on my laptop but when I play it there, it 'jerks' every couple of seconds.  How can I fix both these issues?  Thanks!!

    Select the content which is causing a problem and use the 'Report a problem' button in Your Purchase History on your computer.

  • How to get the Real Path of a file which is accessed  by URL?

    iam using tomcat6.0.
    I have a file xyz.xml at the top of the webapplication HFUSE which i can able to access by URL
    http://localhost:8080/HFUSE/xyz.xml
    My problem is how to get the realpath of the file "xyz.xml" for reading and writing purposes.
    I tried various things but i could not able to successfully solved the problem?
    1) File f = new File("/xyz.xml");
    print(f.getAbsolutePath()) ============== it is not fetching the file @ http://localhost:8080/HFUSE/xyz.xml rather it is creating a file
    at the root of the drive where eclipse is running.
    2) File f = new File("xyz.xml");============> this is also not working , it is creating the file xyz.xml in the eclipse directory ..................
    Can anyone please guide on this problem?

    RevertInIslam wrote:
    If you want your context root(i.e HFUSE)
    use this:
    request.getContextPath() //where request is HttpServletRequest object to get the needful path.
    e.g:
    File f = new File(request.getContextPath()+"/xyz.xml");//it will create the file inside HFUSE.
    Hope this helps.
    Regards
    BWrong. The File constructor expects an absolute filesystem path. The HttpServletRequest#getContextPath() doesn't return the absolute filesystem path, it only returns the relative path from the current context root. Use ServletContext#getRealPath() instead, it returns the absolute filesystem path for the given relative path from the current context root.
    File file = new File(servletContext.getRealPath("/"), "xyz.xml");

  • How to get the page request parameters in Command Button code

    Hi everyone,
    I am new to JSF and working on some Command Buttons. I put my java code via Edit Event, it works fine. But I don't know how to get some parameters from HttpServletRequest.
    Can anyone give some guidance? It would be much appreciated.
    Mike

    Thanks a lot for your tip. Unfortunately I could not open the link you provided due to some network issue.
    Yes, I intend to get some parameters from URL. I did try to put your code and get the parameters predefined in the URL, however I got the null returned. By the way, I put the following code in the page source part and it works. Just don't know how to get the value being passed to the command button event code.
    <%
    String userID = request.getParameter("u");
    System.out.println("this is from head - the userID is :: " + userID);
    %>
    Thanks again and hope you could give me further advice.

  • When i try to watch synced video on my itouch i get "the requested url cannot be found on this server".  I am able to watch the video on my pc in itunes.  however, i cannot watch it on my itouch.

    When i try to watch synced video on my itouch i get "the requested url cannot be found on this server".  I am able to watch the video on my pc in itunes.  However, i cannot watch it on my itouch.  It shows in the video window that the video is there but when i select it to watch it i get the message and then it goes back to the video menu.  It's like it's not really syncing - even though it shows on my itouch.  It doesn't seem to be specific to videos downloaded to the itouch directly or itunes directly.  It's happening to both.

    This is happening to me too. I recently purchased about 4 music videos from iTunes, 3 of them play on both my pc and my iPod Touch but there's one particular music video that will only play on my pc and gives me the same "The requested url cannot be found on this server" message when I try to play it on my iPod. Can someone please rectify?

  • How to get the current page URL

    HI All
    I am working in oracle apps 4.0
    I have one page called history in that i have one page item called Application url. My application id is 122 but its a copy of application 106
    How to get the current page url for the page item.
    Any steps should be help ful
    Thanks & Regards
    Srikkanth.M

    I'm not 100% clear on what the requirement is from the description, however it does sound like you are making things unnecessarily complicated.
    If you want permanent/ID-independent links then use application and page aliases.
    so here we used to display the url like this: <tt>{noformat}http://81.131.254.171:8080/apex/f?p=122{noformat}</tt>
    Do you mean that the URL is displayed like that? If so that doesn't seem particularly helpful. How is anyone supposed to know what it is?
    There are many ways to provide links in APEX&mdash;including lists and nav bars.
    Where the link is to another resource located on the same server (such as another page in the same app, or a different app in the workspace), relative addressing can be used, making it unecessary to include scheme, domain and port information in the URL. For example, if the page to be linked to has a page alias <tt>ABOUT</tt> in an application with alias <tt>UNITY</tt>, and the apps share an authentication scheme/cookie to permit shared sessions, then the link URL is simply
    f?p=UNITY:ABOUT:&APP_SESSION.

  • How to get the current request id in a running request?

    How to get the current request id in a running request?
    Thanks.

    Did you notice that there's a whole section on this forum dedicated to this topic, called E-Business Suite?
    C.

  • How to get the customize url of an portlet using PLSQL

    How to get the customize url of an portlet using PLSQL.

    Are you trying to call the portlet Customization form directly from the browser?

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • How to get the data in servlet if the request encryption type is multipart/

    I am uploading files to the server.
    at that time,before upload ,I need to validate the upload file names.
    so,i am trying to get the value of those files names using
    request.getParameter("jobsheet"); in servlet.
    its giving null insted of file path.
    how to retrieve the the values of parameters if the request is multipart/form-data.
    any help please...

    I think that package works in struts framework right?
    If wrong ,correct me.
    actually I am following MVC pattern.not using struts.
    If this works even in normal web application also.then ok.
    But,Just I am looking how to get the values of jsp parameters
    I have 5 elements in jsp .
    below code:
    <form name="FileUpload" action="./UploadServlet" method="post" enctype="multipart/form-data">
    country <input type="text" name="country" value="">
    year <input type="text" name="year" value="">
    month <input type="text" name="month" value="">
    File<input type="file" name="file1" value="">
    <input type="submit">
    </form>
    I am trying to get the data in servlet like
    String country=req.getParameter("country");
    its getting null.
    I don't know how to get the values if the enctype is "enctype="multipart/form-data"
    If any one knows ,Please suggest me.

  • How to get the transport request for a particular standard text?

    Hi,
    i want to know, how we get the transport request which associated for standard text.
    Please note already the standard text is assigned to the TR using RSTXTRAN program.
    i have a std text. i want to find the related TR for that!
    rds,
    Siva.

    Refer the link. It might tellsa about attaching to transport request but using the way you can find also -
    Re: How To Transport STANDARD TEXTS??
    Regards,
    Amit
    Reward all helpful replies

  • How to get the queries behind a concurrent request

    Hi to all
    how to get the queries behind a concurrent request in oracle Apps R12
    Regards ,
    Zulqarnain

    IMHO you can not simple say that this query executed or another
    because many queries can be executed by one cp
    >
    My actually problem is that, i want to know that when Cost Summary Report from FA Responsibility is running then this concurrent program also run another CP. Populate Balanace Report . This CP also attach with
    Populate Balanace Report GT Data executable , This executable run FA_BALREP_PKG.populate_gt_table procedure.I want to know that which query is running for Cost Summary Report in above mention package.
    >
    it's look like that "Cost Summary Report from FA Responsibility" is main cp which generate the report based on some just-in-time data which generated by "Populate Balanace Report "
    in other words
    "FA_BALREP_PKG.populate_gt_table" populate data in some temp table for report and "Cost Summary Report" use it

  • How to get the number and response time of HTTP request through Weblogic?

    hi,
    does anybody know how to get the HTTP request information through Weblogic server, such as the number of HTTP request in 1 min and the average response time of request in 5 mins ?
    Or is there anyway i can do it through monitoring and get these data then? If so, please help tell me.
    Thanks in advance
    BTW, we don't have the 3rd-party monitoring tool here.

    Hi,
    tables: usr02, usr41.
    data: OPCODE_MODE_COUNT(1) TYPE X VALUE 3,
          modes like sy-index,
          u_MODES LIKE MODES.
    select * from usr02.
      select * from usr41 where BNAME = usr02-bname.
        CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_MODE_COUNT
          ID 'TID' FIELD usr41-TERMID
          ID 'MODES' FIELD MODES.
        IF SY-SUBRC = 0.
          u_MODES = u_MODES + MODES.
        ENDIF.
      endselect.
      if sy-subrc = 0.
        write:/ usr02-bname, u_MODES.
      endif.
      clear u_modes.
    endselect.

Maybe you are looking for