Applet -- Server Name & Port

Hello Java's
How can i get a Server Name and Port inside Applet. I am looking for similiar code in servlet to get the server name and port.
Thanks in advance.

For applet to server communication you can use URL and URLConnection.
URL u = new URL(this.getCodeBase(),"../../myservlet");
Note that if you use a socket the socket does not use your proxy unless you've set it (read
all your clients have set it).
Default settings of the jre is that applets will use the browser's proxy settings but this is
only for URL, sockets don't use your browsers proxy settings at all.

Similar Messages

  • Server name, port from OSB proxy and BPEL processes

    How do I read the server name, port and any other server related information from OSB proxy and BPEL processes?

    http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Java/BEA_WebLogic/Q_24480613.html
    ObjectName service = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
    InitialContext ctx = new InitialContext();
    MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
    ObjectName rt = (ObjectName)server.getAttribute(service,"ServerRuntime");
    System.out.println("Server Name : "+server.getAttribute(rt,"Name"));
    System.out.println("Server Address : "+server.getAttribute(rt,"ListenAddress"));
    System.out.println("Server Port : "+server.getAttribute(rt,"ListenPort"));
    ctx.close();
    By the way, it tool 10 seconds on google ...

  • Generic server name, port, context for deployment

    I need to move my application onto the server for deployment.
    Up til now, I have been running a server using localhost for my
    app. But I need to get the context root and run from there. I tried
    using @ContectRoot but it did not give me the server. Here is a
    snippet from the code? How do I do this?
    // on the deployment I need to replace localhost with server
    name, port, and context root
    public var dbURL:String = "
    http://localhost:8888/proj/loader";
    <mx:HTTPService id="sysOps" useProxy="false" method="GET"
    fault="handleFault(event);" url="{dbURL}"/>

    Only a request has a URL. It's possible for servlets to be mapped to respond to more than one URL, and the server can be configured to respond to more than one host and at more than one port. So none of those things you are asking for have any meaning without an actual request.

  • Finding out a Managed Server Name/Port

    Hi all,
    Hope I have the relevant newsgroup....
    Does anyone know how I might be able to find out the name of the managed server (or its port) that I am currently running on?
    We have a clustered environment (1 admin, 2 managed servers) but I need to get the name of the managed server/port so I can generate some unique information for the server.
    I was reading about JMX and it seems I can return a list of ALL servers configured to run on a cluster. It doesn't really help though as I need to find out the specific server details within the cluster.
    Any help would really be appreciated.
    Cheers,
    Jay.

    Yes, you can use WLST tool :-
    domainConfig()
    cmo.getServers()
    Link : [http://edocs.bea.com/wls/docs100/config_scripting/monitoring.html]
    I hope this helps :)
    Edited by: Manish Chellappan on Jul 22, 2009 9:23 PM

  • Getting the HTTP server name, port and context name inside the init()

    I have a servlet which is initialized when the Web server comes up. Is there any way I can print the complete URL from this servlet?
    I am aware that this can be done by using request object. But note that in this case, there is no request object. All we have is the ServletConfig and ServletContext.
    Pasting a part of my code here.
    public class MyInit extends HttpServlet
    private ServletContext m_servletContext = null;
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    m_servletContext = config.getServletContext();
    //System.out.println("Print the URL here...")
    }

    Only a request has a URL. It's possible for servlets to be mapped to respond to more than one URL, and the server can be configured to respond to more than one host and at more than one port. So none of those things you are asking for have any meaning without an actual request.

  • Error showing in listener while giving tnsping application server name

    iam trying to connect application server with database server.......while giving tnsping from database server as tnsping application_server_name
    its showing error as
    $ tnsping 10.92.5.8
    TNS Ping Utility for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 09-FEB-2007 06:18:05
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Used parameter files:
    Used HOSTNAME adapter to resolve the alias
    Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=10.92.5.8))(ADDRESS=(PROTOCOL=TCP)(HOST=10.92.5.8)(PORT=1521)))
    TNS-12541: TNS:no listener
    but i have set the listener in databse server.
    thsi is my listener.ora
    LISTENER =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=application server name)(PORT=1521))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (GLOBAL_DBNAME=RBTT)
    (SID_NAME=RBTT)
    (ORACLE_HOME=home path of database server)
    if iam connecting sqlplus there in application server and giving username and password
    its showing error as .......
    Enter user-name: xmluser
    Enter password:
    ERROR:
    Enter user-name: xmluser
    Enter password:
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    thanks in advance
    R.Ratheesh

    hi,
    I have changed the listener hostname....before changing the host name also tnsoping database server name works fine....
    i am posting the tnsnames.ora of databse server
    RBTT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL=TCP) (HOST=application server_name) (PORT = 1521))
    (CONNECT_DATA =
    (SERVER=DEDICATED)
    (SERVICE_NAME = RBTT)
    tnsnames.ora for application server
    RBTT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS=(PROTOCOL=TCP) (HOST=database server name) (PORT = 1521))
    (CONNECT_DATA =
    (SERVER=DEDICATED)
    (SERVICE_NAME = RBTT)
    is this is the right one..
    and regarding this connectivity between two servers tnsnames.ora and listener.ora plays a vital role....should i have to make any changes in sqlnet.ora in both application server and database server...should i have to copy sqlnet.ora,listener.ora in application server...and what has to be set in both???
    I have changed sqlnet.ora in database server in names.directory_path=tnsnames.ora
    thanks in advance,
    R.Ratheesh

  • CAN'T Update Server name during login (since I have changed computer name)

    I had a working environment of SAP BO 8.8 installation (VM), I made a second copy for a someone who needs to change his server name so we don't collide with each other.  So he changed his server name fine and now when we try to change the name during login in SAP BO, we are completely unable to do anything, no company or database shows up and when you try typing server name it won't allow you since it is a drop down, the only availble server name is the old server name.
    We went to Service Manager, got a new license key for the hardware key, update fine as well as updating the server name there but when we try login, we are not able and no matter what we do we are not able to change the server name.  Please help, it is getting desperate (tried all things possible).
    Thanks

    In working VM copy, do a global search for the server name in all configuration files in SAP install directory.  Then compare with copied copy and try to change appropriate names in all files.
    Changing server name is a complex process, it has many references in many configuration files that you may have to touch.
    This will be an uphill battle. Goodluck.
    Lots of other things you can do, ping by hotname, check hostfile in case vm is also using it, there are two types of vm installs network or self contained (something like that) - so hostname may be getting masked by vm network environment, definitely SAP has few configuration files where the Server name, db name, license server name, port etc are present, even check for firewall settings etc.

  • Yosemite 10.10.2 server app. FTP help. I have a program running in my local server enviroment that wants to FTP to my mac folder. It asks for the server , name, password, port and path. what are they?

    So I have set up a localhost area in my Mac. I have the new server.app and I am running yosemite 10.10.2 .
    I have a program running in my local server enviroment that wants to FTP to my mac .
    It asks for the server , name, password, port and path. what are they?
    I am pretty certain that the Serveris "localhost",
    Name is my macs name (like my-mac-min)
    password is "my login password"
    and they suggest port 21.
    But what is the file path, lets just say my site is set up http://localhost/siteftp and is actually at my Users/Sites/siteftp folder.
    Why cant this program connect to the mac.
    Is it because they are both operating in the same localhost enviroment,
    could it be my folder permissions are not correct on siteftp folder?
    Help please !

    I tried turning the computer off and then back on. The alerts don't show the notice to update as resolved. Hopefully this is not a problem or an indicator or another problem. Should I ignore or reload 10.10.1 from the app store to trigger a resolved check in a green circle?
    Interesting that I had to buy server software after my free Yosemite download. I would have hoped that the two pieces of software would have gone together without any complication. It is not positive to end up buying a problem. Ah well, time to move on.

  • How to get server name and port of OSB server in a proxy service ?

    I need to get the server name and port of the OSB server inside a proxy service. How can I get this?

    You may use java callout for this purpose -
    How to get ServerName and ApplicationName in OSB (ALSB) ?
    Regards,
    Anuj

  • Issue with XML post when port used with server name

    Hi Guys,
    We are currently using an agent on our application servers which puts a server in "inservice standby" if the CPU load on the system goes above 75%. This agent is using an XML post on the CSM to achieve this and put the server back inservice using XML post as well.
    Currently we are trying to use the same agent for another application which has a port number defined as well and it does not seem to work.
    To give an example where it works:
    serverfarm TEST
    nat server
    nat client TEST
    real name BLABLA
    inservice
    The example where it does not work:
    serverfarm TEST
    nat server
    nat client TEST
    real name BLABLA 50000
    When we get the server name via XML we see that CSM returns the name as BLABLA: 50000 however using the same in the script does not work.
    Would someone know how to put the port number in an XML script so that the CSM understands which server need to be changed.
    Thanks,
    Murtaza

    It would be some thing in line with the following example
    <?xml version="1.0" ?>
    The DTD for CSM XML will let you know what tags and attributes are available to use:
    http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/mod_icn/csm/csm4
    _1_2/icn/xmldtd.htm
    HTH
    Syed

  • Application server name and port number

    Hi
    Is it possible to get the application server name(ip) and port number at runtime. Becuase i want to open an html file which is in the application server, when a button is pressed by using web.show_document ();
    Can anyone guide me please.
    Thanks in advance
    geethu

    application server name and port number

  • Hiding the Port in a Virtual Host/Server-name Alias

    I need some guidance/help with the HTTP Server in AS 10g. We have several new Portal sites with a mix of forms, reports, and pl/sql server pages. We wish to make these services available from the internet via an aliased hole in the firewall.
    We have our public alias of Alias.CompanyWebsite.com mapped to the server-name, but we'd like to get the alias mapped to servername:port. I've tried to get this set up using virtual hosts in the HTTP server, but I'm having no luck. I'm also having trouble finding documentation on how to this.
    Is there a way to hide the server-name and port number via a virtual host (alias) in HTTP Server and/or Web Cache? If so, how do you accomplish this?
    Thanks,
    Josh

    Usually it is like this:
    outside name: www.acme.com
    oudside port: 80
    inside name: inside.acme.local
    inside port: 7778 (if you have a seperate machine for the middle tier)
    In the Webcache you'll need a site
    www.acme.com with port 80
    and an origin server
    inside.acme.local with port 7778
    Then create a site-to-server mapping from www.acme.com to inside.acme.local
    If your firewall listens to another name or does something with the ports you need to change the site accordingly.
    cu
    Andreas

  • Agentry Client 6.1.3 installation with preconfigure SMP server name et TCP Port

    Hi,
    I'm looking for a way to deploy an Agentry Client (version 6.1.3.xxx) on multiple devices without having to manually specify the SMP server name and TCP port.
    When the user get's it, I just want him to only enter his credential to start the first synch/config process.
    Anyway do easily do that?
    Thanks for your help!
    Eric

    Hi Bill,
    Here's what I did in more detail so you can pin point what I do wrong (hopefully :-)).
    First I extracted the branding files of the Agentry_6.1.3.10212_ClientWin32.exe.
    Agentry_6.1.3.10212_ClientWin32.exe /Branding=D:\Temp\Agentry.
    This is the directory and file structure I got out of it.
    The 2 directories are created as you mentionned.
    If I browse to the AgentryClient_Win32 directory I see thoses files:
    If I browse the Installer directory I see :
    The Include and Plugins directories are as follow :
    I still can't find the AgentryClient.exe.config file???
    Eric

  • How to get Server Name and port. Urgent.....

    Hi,
    Please let me know how can i get the server name and port without using request object.
    I am getting it :- request.getServerName();
    But, pl. let me know how can I get it without using this request object.
    Waiting for reply..

    I don't know of any way to trivially access that, but why do you need to do this? If you need access to that information in a method that can't see your HttpServletRequest, then perhaps your architecture has a flaw, and you'll be better off in the long run restructuring it.

  • Customizing server.name and server.port in services-config.xml

    Hi
    How can i find out what does BlazeDs use for server.name and server.port in
    url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
    can i customize those values?
    thank you

    Mete
    Thank you for your reply
    So context.root is resolved at compile time and server & port at runtime
    Do you have an example or a link that shows / explain how to create custom tokens replaced by JVM options?
    I have an issue where if i install my app on http://www.mydomain.com/mycontext/, it loads but will display the following message when making server call using Safari
    FAULT: faultCode:Client.Error.MessageSend faultString:Send failed faultDetail:Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: http://www.mydomain.com/context/messagebroker/amf
    Notte that it works on IE7 when accessing http://www.mydomain.com/mycontext/
    and that it works great with all browsers on http://localhost:8080/mycontextroot
    Would you know what is the best way to debug this issue?
    Thank you
    matt

Maybe you are looking for