How to retrieve client's IP address in servlet

thanks

According to the API documentation for ServletRequest, it has this method:
getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request.
Was that what you wanted?

Similar Messages

  • I would like to ask how to retrieve Sever/Host IP address.

    Hello,
    I would like to ask how to retrieve Sever/Host IP address.
    sys_context('USERENV', 'IP_ADDRESS') returns client's IP address only, but what I want to acquire is Host/Server IP address
    Thank you

    This is why it is generally useful to mention the version of Oracle you are using, particularly if you are using a version 4 releases old...
    That said, you can probably still use the UTL_INADDR package
    SQL> select utl_inaddr.get_host_name( null ) from dual;
    UTL_INADDR.GET_HOST_NAME(NULL)
    DDBCJC01
    SQL> select utl_inaddr.get_host_address( null ) from dual;
    UTL_INADDR.GET_HOST_ADDRESS(NULL)
    192.168.1.107Justin
    Edited by: Justin Cave on Sep 29, 2008 10:54 PM

  • How to retrieve client certificate information from sender mail adapter

    Hi, expert:
    I have a requirement to verify the validation of coming email with digital certification. The mail is with digital certification. If the coming email is valid, I 'll get the attachemt of the mail for further processing. I have a sender mail adapter and receiver file adapter configued.
    I have already my own developed adapter module, which is configued in mail adapter. My question is how to retrieve the detailed certificate information in the adapter module developed by myself. Is it feasible?
    Thanks a lot.

    The WL-Client-Proxy cert should be the cert used on the proxy side if SSL is configured between Apache and WebLogic, so I believe that is the reason why that does not work. Basically, the problem here is that SSL is end-to-end, and the two ends of this transaction are the client and apache.
    That said, when you add the +ExportCertData option, this should record the client's SSL certificate in the vairable SSL_CLIENT_CERT.  So you should be able to use request.getAttribute("SSL_CLIENT_CERT").
    See:
    http://www.modssl.org/docs/2.8/ssl_reference.html
    If this doesn't work for you (which is possible if the WL_Proxy is doing something funny to the request), it is probably best just to dump out the entire contents of the session, and see what you have:
    for (Enumeration e = request.getAttributeNames() ; e.hasMoreElements() ; ) {
    String attr = (String)e.nextElement();
    System.out.println("ATTR = " + attr);
    System.out.println("VAL = " + request.getAttribute(attr));
    If you can't see any SSL certificate there, you will have to work out some way to pass this on manually.
    cheers,
    Trevor

  • How to retrieve the server IP address

    Hi Experts,
    In my scenario, if some problem occur, then the XSLT mapping sends a mail to some one,subject is 'PRD', if we execute this from production or quality or development server.
    But now i want to know this mail from which server, so i want to change the subject line as 'PRD' if it is only from production system otherwise 'OTH', how to achieve this ? No hard code allow at any where.
    I have one thought, if we find the server ip address then we can recognize, but how to get the server IP address ? Is it possible ?
    Thanks
    Ramesh

    Hi,
    My source is some WSDL file, this is more than 15000 characters so i am unable to send the full file.
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
         <wsdl:types>
              <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                   <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />
                   <xsd:element name="Pip3A4PurchaseOrderRequest" type="Pip3A4PurchaseOrderRequest" />
                   <xsd:complexType name="Pip3A4PurchaseOrderRequest">
                        <xsd:sequence>
                             <xsd:element name="fromRole" type="fromRole" />
                             <xsd:element name="GlobalDocumentFunctionCode" type="xsd:string" />
                             <xsd:element name="PurchaseOrder" type="PurchaseOrder" />
                             <xsd:element name="thisDocumentGenerationDateTime" type="thisDocumentGenerationDateTime" />
                             <xsd:element name="thisDocumentIdentifier" type="thisDocumentIdentifier" />
                             <xsd:element name="toRole" type="toRole" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="fromRole">
                        <xsd:sequence>
                             <xsd:element name="PartnerRoleDescription" type="PartnerRoleDescription" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PartnerRoleDescription">
                        <xsd:sequence>
                             <xsd:element name="ContactInformation" type="ContactInformation" minOccurs="0" />
                             <xsd:element name="GlobalPartnerRoleClassificationCode" type="xsd:string" />
                             <xsd:element name="PartnerDescription" type="PartnerDescription" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="ContactInformation">
                        <xsd:sequence>
                             <xsd:element name="contactName" type="contactName" minOccurs="0" />
                             <xsd:element name="EmailAddress" type="xsd:string" minOccurs="0" />
                             <xsd:element name="facsimileNumber" type="facsimileNumber" minOccurs="0" />
                             <xsd:element name="telephoneNumber" type="telephoneNumber" minOccurs="0" />
                             <xsd:element name="PhysicalAddress" type="PhysicalAddress" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="contactName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="FreeFormText">
                        <xsd:simpleContent>
                             <xsd:extension base="xsd:string">
                                  <xsd:attribute ref="xml:lang" />
                             </xsd:extension>
                        </xsd:simpleContent>
                   </xsd:complexType>
                   <xsd:complexType name="facsimileNumber">
                        <xsd:sequence>
                             <xsd:element name="CommunicationsNumber" type="xsd:string" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="telephoneNumber">
                        <xsd:sequence>
                             <xsd:element name="CommunicationsNumber" type="xsd:string" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PartnerDescription">
                        <xsd:sequence>
                             <xsd:element name="BusinessDescription" type="BusinessDescription" />
                             <xsd:element name="GlobalPartnerClassificationCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="PhysicalAddress" type="PhysicalAddress" minOccurs="0" />
                             <xsd:element name="ContactInformation" type="ContactInformation" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="BusinessDescription">
                        <xsd:sequence>
                             <xsd:element name="GlobalBusinessIdentifier" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalSupplyChainCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="businessName" type="businessName" minOccurs="0" />
                             <xsd:element name="NationalBusinessTaxIdentifier" type="NationalBusinessTaxIdentifier" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PurchaseOrder">
                        <xsd:sequence>
                             <xsd:element name="AccountDescription" type="AccountDescription" minOccurs="0" />
                             <xsd:element name="comments" type="comments" minOccurs="0" />
                             <xsd:element name="ContractInformation" type="ContractInformation" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="DocumentReference" type="DocumentReference" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="FinancingTerms" type="FinancingTerms" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="generalServicesAdministrationNumber" type="generalServicesAdministrationNumber" minOccurs="0" />
                             <xsd:element name="GlobalGovernmentPriorityRatingCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalPurchaseOrderFillPriorityCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalPurchaseOrderTypeCode" type="xsd:string" maxOccurs="unbounded" />
                             <xsd:element name="governmentContractIdentifier" type="governmentContractIdentifier" minOccurs="0" />
                             <xsd:element name="installAt" type="installAt" minOccurs="0" />
                             <xsd:element name="isDropShip" type="isDropShip" />
                             <xsd:element name="OrderShippingInformation" type="OrderShippingInformation" minOccurs="0" />
                             <xsd:element name="ProductLineItem" type="ProductLineItem" maxOccurs="unbounded" />
                             <xsd:element name="proprietaryInformation" type="proprietaryInformation" minOccurs="0" />
                             <xsd:element name="requestedEvent" type="requestedEvent" minOccurs="0" />
                             <xsd:element name="requestedShipFrom" type="requestedShipFrom" minOccurs="0" maxOccurs="unbounded" />
                             <xsd:element name="SecondaryBuyer" type="SecondaryBuyer" minOccurs="0" />
                             <xsd:element name="shipTo" type="shipTo" minOccurs="0" />
                             <xsd:element name="TaxExemptStatus" type="TaxExemptStatus" minOccurs="0" />
                             <xsd:element name="totalAmount" type="totalAmount" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="AccountDescription">
                        <xsd:sequence>
                             <xsd:element name="accountName" type="accountName" />
                             <xsd:element name="AccountNumber" type="xsd:string" minOccurs="0" />
                             <xsd:element name="billTo" type="billTo" minOccurs="0" />
                             <xsd:element name="CreditCard" type="CreditCard" minOccurs="0" />
                             <xsd:element name="financedBy" type="financedBy" minOccurs="0" />
                             <xsd:element name="GlobalAccountClassificationCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="prePaymentCheckNumber" type="prePaymentCheckNumber" minOccurs="0" />
                             <xsd:element name="WireTransferIdentifier" type="xsd:string" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="accountName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="billTo">
                        <xsd:sequence>
                             <xsd:element name="PartnerRoleDescription" type="PartnerRoleDescription" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="PhysicalAddress">
                        <xsd:sequence>
                             <xsd:element name="addressLine1" type="addressLine1" minOccurs="0" />
                             <xsd:element name="addressLine2" type="addressLine2" minOccurs="0" />
                             <xsd:element name="addressLine3" type="addressLine3" minOccurs="0" />
                             <xsd:element name="cityName" type="cityName" minOccurs="0" />
                             <xsd:element name="GlobalCountryCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="GlobalLocationIdentifier" type="xsd:string" minOccurs="0" />
                             <xsd:element name="NationalPostalCode" type="xsd:string" minOccurs="0" />
                             <xsd:element name="postOfficeBoxIdentifier" type="postOfficeBoxIdentifier" minOccurs="0" />
                             <xsd:element name="regionName" type="regionName" minOccurs="0" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="addressLine1">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="addressLine2">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="addressLine3">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="cityName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="postOfficeBoxIdentifier">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="regionName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="businessName">
                        <xsd:sequence>
                             <xsd:element name="FreeFormText" type="FreeFormText" />
                        </xsd:sequence>
                   </xsd:complexType>
                   <xsd:complexType name="CreditCard">
                        <xsd:sequence>
                             <xsd:element name="cardHolderName" type="cardHolderName" />
                             <xsd:element name="creditCardIdentifier" type="creditCardIdentifier" />
                             <xsd:element name="expiryDate" type="expiryDate" />
                             <xsd:element name="GlobalCreditCardClassificationCode" type="xsd:string">

  • How to check client machine IP address or Machine name

    I'm trying to check the client machine's IP address to restrict the unauthorised login in unassigned workstation. Any body know how to get the IP address of client machine? Is there any built in function to get it. I'll appreciate if you could send me email. Thanks.

    Hi,
    with the following statement you can get your pc's machine name:
    SELECT UPPER(USERENV('TERMINAL'))
    FROM DUAL;
    Be careful that, if you are dealing with a web envinronment, the outcome will be the Forms Server machine name.
    Regards,
    Marco

  • How to retrieve client certificate passed by Apache proxy

    Hi all,
    Here's my configuration:
    Client <--HTTPS-->Apache Proxy (2-way SSL) <-- HTTP --> WLS 8.1
    I need to be able to access the client certificate passed to Apache by the client in my Java applications hosted on WLS.
    Here's what I did:-
    <pre>1. Set up Apache 2-way SSL. Tested ok.
    2. Set up Apache-Weblogic proxy. Tested ok for both HTTP, and server-side HTTPS.
    3. Configured Apache's ssl.conf SSLOption to export certifiate data: SSLOptions +ExportCertData.
    4. In my application, I used request.getAttribute("javax.servlet.request.X509Certificate") to try and retrieve the certificate.</pre>
    However the certificate don't seem to be passed along to Weblogic :-(
    Any ideas if I'm missing any steps from above? Or if it's even possible to do this?
    Thanks for any suggestions!
    Any ideas

    The WL-Client-Proxy cert should be the cert used on the proxy side if SSL is configured between Apache and WebLogic, so I believe that is the reason why that does not work. Basically, the problem here is that SSL is end-to-end, and the two ends of this transaction are the client and apache.
    That said, when you add the +ExportCertData option, this should record the client's SSL certificate in the vairable SSL_CLIENT_CERT.  So you should be able to use request.getAttribute("SSL_CLIENT_CERT").
    See:
    http://www.modssl.org/docs/2.8/ssl_reference.html
    If this doesn't work for you (which is possible if the WL_Proxy is doing something funny to the request), it is probably best just to dump out the entire contents of the session, and see what you have:
    for (Enumeration e = request.getAttributeNames() ; e.hasMoreElements() ; ) {
    String attr = (String)e.nextElement();
    System.out.println("ATTR = " + attr);
    System.out.println("VAL = " + request.getAttribute(attr));
    If you can't see any SSL certificate there, you will have to work out some way to pass this on manually.
    cheers,
    Trevor

  • How to retrieve VM's IP Address using WMI query

    Hi,
    Please let me know the WMI query to retrieve the IP of the Hyper-V VMs via Host.
    Regards
    Raamesh Keerthi N J

    try this in powershell
    $VMS = get-vm
    $outputArray = @()
    foreach($VM in $VMS)
          $output = new-object psobject
          $output | add-member noteproperty "VM Name" $VM.Name
          $output | add-member noteproperty "Description" $VM.Description
          $output | add-member noteproperty "RAM(MB)" $VM.Memory
          $output | add-member noteproperty "vCPU" $VM.CPUCount
          $output | add-member noteproperty "Status" $VM.Status
          $output | add-member noteproperty "State" $VM.VirtualMachineState
          $output | add-member noteproperty "IsHighlyAvailable" $VM.IsHighlyAvailable 
          $output | add-member noteproperty "Cloud" $VM.Cloud
          $output | add-member noteproperty "HostName" $VM.Hostname
          $output | add-member noteproperty "Integration Tools" $VM.VMAddition
          $output | add-member noteproperty "Operating System" $VM.OperatingSystem
          $output | add-member noteproperty "Location" $VM.Location
          $output | add-member noteproperty "VMID" $VM.VMID
          $outputArray += $output
    write-output $outputarray | sort "VM Name" | format-table * -autosize | out-string -width 600 | out-file $file -append
    Get-SCVirtualNetworkAdapter -all | select name, vlanid | sort "Name" | format-table * -autosize | out-string -width 600 | out-file $file -append
    #load the report in notepad
    notepad.exe "C:\scripts\reports\Report_$DATEStamp.txt"
    exit
    [email protected] visit my blog stephanco.blogspot.com

  • How to retrieve available (server)-IP addresses on a LAN

    Is there a method to get all/the available (server)-IP-address(es) on a LAN from the host program?
    As far as I understood the samples (e.g. in tcpex.llb) the host (or it's operator) has to know the IP-address of the server to start communication. However it would ease the usage of a host-program if all/the available server(s) could be selected e.g. from a list-box.
    I posted this question already yesterday with some additional explanations however couldn't find it in my "posted questions"-list. So I try again.

    You don't tell us enought about the type of "servers" you mean. Are these all LabVIEW programs? In this case it should be relatively easy for them to keep each other updated at regular interval, e.g. via UDP multicasts.
    Alternatively, your servers can announce themselves via a UDP packet to the subnet broadcast address and to a specific port.
    If these are servers with code not under your control, you need to probe them. This is not such a big deal on your private LAN and I don't think it will trigger IDS systems. Keep a short list of all possible server IPs, then try to connect at the specified port at regular intervals using a short timeout.
    Are you communicating with TCP or UDP?
    In the absence of firewall code, you can have 3 possible responses for TCP:
    (1) No response --> The server computer is down (or there is a stealth personal firewall running). You get a TCP timeout error.
    (2) Active rejections (TCP RST packet) --> The server computer is up, but the server program is not running. Nothing is listening on the target port. You'll get an error.
    (3) Accepted connection (SYN-ACK) packet. --> The server is up and listening for connections. The threeway handshake can be completed. No error.
    UDP is a bit trickier, because it is connectionless. Many UDP services are one-way. For example a syslog server just receives packets, it never acknowledges anything.
    It is easy to tell if the server computer is up, but the service is not listening. In this case you get an ICMP(3,3) response and an immediate error.
    If the service is listening, you either get nothing or a specific response, depending on the type of server. If you are waiting for return traffic, you'll get a timeout error in UDP read either way.
    (If you just want to check if the server computer is actually up, probe it on a unlikely high port that virtually guarantees an ICMP(3,3) response in the absence of a personal firewall program.)
    LabVIEW Champion . Do more with less code and in less time .

  • How is a client certificate accessed from a servlet that received a SSL3 enabled client-side cert required request

    I would like to know the variables in the http header that hold the client cert information simillar to SSL_CLIENT_CERT variable in apache and how do I access these from a servlet ?

    I would like to know the variables in the http header that hold the client cert information simillar to SSL_CLIENT_CERT variable in apache and how do I access these from a servlet ?

  • How to retrieve Delivery address when entered manually in PO

    Hi All,
    I am trying to print PO through Smartform. I am retrieving the delivery address based on the adrnr number/Customer number/Vendor Number from EKPO table. Now when the user manually changed the address with out adrnr/Customer number/Vendor Number, how to retrieve that address in order to print as these three fileds will be blank in EKPO table. How and where the SAP will store that address. Any help thanks.

    Hi,
        In the sales order point of view I know it will be stored in the ADRC table for the VBPA-ADRC number entry. Similar to that I hope the EKPO ADRC will have an another entry in the ADRC table.
    Thanks,
    Greetson

  • How to change the web service address of NetBeans generated WS client

    I am currently experimenting with web services using netbeans and Sun Application Server.
    Basically I am creating simple web services using net beans and then deploy them on the app server and then create another pfoject with web service reference to that web service to invoke the service.
    My problem is when a project is deliverd to the production site the the client applications web service reference will need to be configured to refer to the production web service address. But when I looked at the generated web service client code the address is hard coded.
    How can I change the address to the web service of a web service reference created in net beans either using some configuration file (without having to recompile the client) or at runtime.
    Thanks in advance

    bump...

  • How to get Client IP address in oracle apps. Are there any API's.

    hi,
    I have one query
    ->How to get Client IP address in oracle apps. Are there any API's.
    regards,
    krishna

    Hi,
    this is very usefull
    however are this data stored on the db or is only a temporary view?
    I would like to have to keep track of all client connected.
    Thanx a lot

  • How to retrieve system Information on client machine Using Applets

    How to retrieve video card information on client machine using applets and JNI, please suggest me on this
    Thanks
    GReddy

    1. Research platform specific OS API to do whatever you want with video cards
    2. Write C/C++ code to wrap the functionality in 1 into something looks closer to what you want to see in java
    3. Write a class that models the functionality of 2 with native methods.
    4. Write the native methods of 3 such that they call the methods of 2.
    Note that steps 1 and 2 have NOTHING to do with jni nor java. So you start by looking somewhere else for the answers to that.

  • How do I edit the email address that's set-up in my iPad Mail client?  It's at iOS7

    How do I edit the email address that's set-up in my iPad Mail Client Account?  It's at iOS7 and the email address was entered incorrectly; this means the email doesn't work.  There's an Edit button, which causes 3 horizontal lines to apperar at the end of the field, but does not seem to allow me to place the cursor in the field and correct the error.  Unless I can correct this I'll have delete the account and start again so if anyone's able to tell me how to edit that address that would be briliant?  Here's hoping................

    Thanks mabaeyens; it IS the address entered in the email account, on the iPad, but sadly, as explained above, once you get to the Settings > Mail, Contacts, Calendars > Account > tap in the wrong account > Email and then hit edit, the 3 horizontal lines appear at the end of the field but touching the screen within the text of the incorrect address doesn't make the cursor appear, so I can't edit!  Very frustrating obviously.  In the edit mode you can drag the field up and down the page but that's all............

  • Please help. my address bar has vanished. i have no idea how to retrieve it, so can only access bookmarked sites when using firefox.

    please help. my address bar has vanished. i have no idea how to retrieve it, so can only access bookmarked sites when using firefox.

    Make sure that you do not run Firefox in Full Screen mode with all toolbars hidden.
    * Press F11 to toggle full screen mode (Firefox/File > Full Screen)
    If the menu bar is hidden then press the F10 key or hold down the Alt key, that should make the menu bar appear.
    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    * If items are missing then open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout" (Linux, Windows)
    * If a missing item is in the toolbar palette then drag it back from the Customize window on the toolbar
    * If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up.
    See also:
    * http://kb.mozillazine.org/Toolbar_customization

Maybe you are looking for