Servlets: how do I get client's environment variables

Hi everybody
I make various servlets, and like to get the client's environment variables (such as used by the SET command under Windows). Especially username which is set in Windows-NT.
Are there any straight forward way to get these?
.. or can I get them and return them via a javaScript?
Arne

The servlet runs on the server. The browser and JavaScript run on the client. If you wanted to use JavaScript to pass them back, you would have to pass them back to the server through another servlet.
Or you could use an applet and get at the standard Java properties. Nobody should use environment variables anyway, as you can't guarantee a computer even has them. :-)

Similar Messages

  • How do i get value of Environment variables from a java program?

    Hai,
    I have a setup file wherein i set the path for the root directory , in the following way.
    setenv TPEROOT "/home/systpe/khurram/changes"
    when i give echo $TPEROOT
    the path , home/systpe/khurram/changes , is displayed on the console
    If i want to assign the $TPEROOT to a string variable str in my java program , then how can i do it.
    I want to use the value of the environment variable in my program.
    Any help in this regard would be very useful
    Thanks
    khurram

    java -DTPEROOT=$TPEROOT myőackage.myclass myargs

  • How can I get client IP address in portlet (servlet) ?

    How can I get client IP address in portlet (servlet) ?
    request.getRemoteAddr() return server IP.
    May be I must use Portal API, which extend Servlet classes, but I can't find this.
    Can any help me?

    Hi,
    Following query can help you to get the Client IP Address.
    select sys_context('userenv','ip_address') from dual;
    Thanks,

  • How can I get Client IP Address in oracle?senthil

    How can I get Client IP Address in oracle?senthil

    Hi,
    Following query can help you to get the Client IP Address.
    select sys_context('userenv','ip_address') from dual;
    Thanks,

  • How to Get the Client's Environment Variables?

    I have a page which need inputing account of the intranet then send a mail upon the intranet.So,it is important for me to verify if the account is legal or if this account is the user himself or herself in order to refuse any bad sending.
    Of course I can get Environment Variables of "user.name" of my own PC.But How can I get Others before they can send mail?

    You can't read with an applet some system properties, including the "user.name" property. Not even with a signed applet.
    Here you have some links:
    http://java.sun.com/docs/books/tutorial/applet/practical/properties.html
    http://java.sun.com/docs/books/tutorial/applet/practical/security.html
    http://java.sun.com/sfaq/#getProps
    So you should find another way, for instance authentication.

  • How to i get client IP address of a system on Oracle E-biz

    We are trying to extend our audit to getting the client IP address of a system on Oracle E-biz. This is to track down some users trying to perform a fraudulent act. Anybody has an idea. Maybe there are some scripts i need to run.

    Hi user;
    Please check:
    How to get Client IP address in oracle apps. Are there any API's.
    Re: How to get Client IP address in oracle apps. Are there any API's.
    Hope it helps
    Regard
    Helios

  • Getting a Unix environment variable

    Hi, everyone.
    I need to use a Unix enviroment variable from a form. This form
    is gonna use this variable in order to be the path of another
    form who is gonna be called.
    In other words:
    CALL_FORM( $unix_var + '/forms/myform_name' );
    unix_var is what I want to get.
    Thanks a lot in advance,
    Eduardo

    It worked, Michael. Thanks a lot!
    To the documentation guys at Oracle... This is how you define
    the TOOL_ENV package in the Forms' help:
    "The TOOL_ENV package allows you to interact with Oracle
    environment variables by retrieving their values for use in
    subprograms."
    Suggestion: ...with Oracle environment variables AND OTHER
    SYSTEM OPERATION ENVIRONMENT VARIABLES...
    because this narrow definition can prevent people for trying to
    use it to retrieve other NON-ORACLE environment variable via
    this package. Thanks.

  • How does java access user specific environment variables ?

    Hi,
    I'm running a java application on a W2K o/s. My application needs to be able to access the user environment variables in Windows but I don't know how to do this. Can anyone help ?
    Thanks.

    http://www.rgagnon.com/javadetails/java-0150.html

  • How to find the previous path environment variable in windows 2008

    I am reconfiguring the Hyperion 11.1.2, and later, I installed the ODI. And them when I come back to reconfigure the Hyperion, it cannot be reconfigured, and say cannot find the path parameter. And I check the PATH environment variable, and find it is showing a dumy value, do we have a way to recover the previous PATH envirnment variable?

    To get the source IP address, you will need to enable File Share auditing: http://technet.microsoft.com/en-us/library/dd772690%28v=ws.10%29.aspx
    Otherwise, you can simply disconnect the user session.
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • How do I use a UNIX environment variable for the path of a file name

    We are running Forms 6i over the web. The forms server runs on a UNIX (HP-UX) machine.
    I want to read the contents of a file, which is simple enough, using the TEXT_IO package. However, I want to reference a UNIX environment variable that specifies the file path i.e
    PROCEDURE get_file IS
    in_file Text_IO.File_Type;
    linebuf VARCHAR2(1800);
    filename VARCHAR2(200);
    BEGIN
    filename:= '$LOG_DIR/RCAS181.log';
    in_file := Text_IO.Fopen(filename, 'r');
    .....other stuff
    Notice the filename string references my unix env variable '$LOG_DIR'. However, this doesnt work. If I put the full pathname it works fine.
    Any suggestions ?

    Have a look at TOOL_ENV.GETVAR()

  • How to Set a machine level Environment variable in remote machines

    Hi,
    I have to set a List($ProjectName) as the value of an environment variable($PROJECTS).
    The cmdlet which I tried is :
    $remoteMachineList = 'machA', 'machB'
    $ProjectName = 'ProjA', 'ProjB', 'ProjC'
    foreach($remoteMachine in $remoteMachineList){ icm -comp $remoteMachine {
    [Environment]::SetEnvironmentVariable("PROJECTS",$ProjectName,"Machine")
    This doesn't throw any errors but it's not setting the value of it. If I give a string or an integer value directly instead of the $ProjectName in the above code, it's working fine.
    PLease Help, Thanks in advance !

    You have to do a little more work when supplying outside variables into a PSSession (using Invoke-Command in this case) by using the -ArgumentList parameter and supplying a Param() statement in the scriptblock.
    $remoteMachineList = 'machA', 'machB'
    $ProjectName = 'ProjA', 'ProjB', 'ProjC'
    foreach($remoteMachine in $remoteMachineList){
    icm -comp $remoteMachine {
    Param ($ProjectName)
    [Environment]::SetEnvironmentVariable("PROJECTS",$ProjectName,"Machine")
    } -ArgumentList $ProjectName
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • How to read a non-oracle environment variable?

    I have been trying to read a non-oracle environment variable using TOOL_ENV.GETVAR, and have come to understand that it doesn't work. Is there another function that can do what I want? I don't want to hardcode the directory the forms and reports must reside in, but can't find anyway to make this value flexible.
    can anyone help ?
    thx
    adam

    I figured out a way. I put a String in the registry in the oracle home area, and can read it with TOOL_ENV.GETVAR now. It appears that it reads from the registry, not the environment variables. Except for unix apparently, where it reads environment variables.
    adam

  • How do I get my WebLogic environment back to square one?

    Having run into a show-stopper bug in NetBeans, I have been playing around with JDeveloper 11.1.2 on Windows 7. I have run into a situation where several older versions of a session bean seem to persist in the server and nothing I do can find or remove them. undeploy says they aren't there, but when I try to test my web service (created top-down from WSDL), it says that the context is already in use and refuses to run the test. Yet I can create a .NET client and test the web services from there, so they are actually deployed.
    Is this a bug in the test web service part? Is there a way to tell the Test Web Service bit to not try to deploy several versions of the app (it appears to install 2, but only one exists) before testing?
    After every test, I deleted the application and/or project and everything under it and started again. I may have forgotten to undeploy once or twice but followed up with that later.
    It's turning out that it would be easier to simply write my own web services socket handler than to fight with the tool. There must be a way to reset WebLogic so it doesn't think it's got 2 versions of the same thing.
    I'm going to uninstall the whole thing, delete all pieces, then reinstall it all, but I'm sure I'll do this to myself again and I'd really like to have a better solution to this. JBuilder is primitive but it doesn't give you all these promises of easy going, only to let you down... :(
    Any ideas? Any quick way to clear out all spoor?
    TIA

    Hi Robert,
    Are you using the integrated server provided with JDeveloper? If so, one option is to go directly to the <JDEV_System_directory>\o.j2ee\drs should have your previously deployed application. You could manually try to go and remove all the previous versions of your application and re-deploy.
    Juan Camilo

  • How can I get informations about PATH variable ?

    I have a programme installed on my computer and I need informations about its path. For example I can get Java home path like this:
    System.getProperty("java.home");, but how can I do that for my programme.
    If you know another way I can do this please let me find out.
    Thanks !

    To sergey35:
    Thanks! This work very well.
    Now I want to launch an application from java, but I don't know how can I test if my application exists (is installed).
    For example if I want to launch winamp or any other application, but how can I verify if my application exists indeed. The end user isn't interested if my application really exists. He push a button and he wants to launch that application. If it doesn't exists I have to notify through a message this fact. And most difficult I think is to know exactly the path where is installed that application.
    If anyone can help me with documentation or suggestions please reply to this thread.
    Thanks!

  • Not able to get SSL related CGI Environment Variables?

    We are currently using APEX 3.2.0.x, OHS 10.1.3.x, and 11gR1 on linux. The APEX application we've been developing will be accessed via SSL and x509 certificates such that a client certificate is passed from a user's browser to the OHS, the information will be read from the certificate, and if the user's cert information exists in a user table associated with the application, they will have the role they've been assigned as an existing user within the application. Otherwise, the user will be a guest and have a minimum role accessing the application.
    We are certainly not guru's when it has come to setting up and configuring SSL and certs, but we have gotten to the point where we have all of the required certs created and installed, and the client cert passes it's information successfully to the OHS to get to the "home" page of the application via the Rewrite statement in the httpd.conf/ssl.conf that points to the appropriate https url. We are now at the point where we need the APEX application page to read the cert information, and this is where we are having problems.
    We have created an "On Load - Before Header" process and temporary item on the "home" page to display CGI environment variables to see what we're getting. It's a PLSQL Anonymous block like this:
    DECLARE
    lUserName VARCHAR2(100);
    BEGIN
    SELECT NVL(owa_util.get_cgi_env('REMOTE_USER'),'NOT POPULATED') INTO lUserName FROM DUAL;
    :P1_REMOTE_USERNAME := lUserName;
    END;
    We can grab any of the cgi environment variables that are listed in the OHS mod_plsql User's Guide. We cannot seem to be able to get any of the SSL CGI environment variables though. We are adding the SSL variables to the dads.conf via the PlsqlCGIEnvironmentList parameter (ex: PlsqlCGIEnvironmentList SSL_CLIENT_S_DN_CN) and bouncing the OHS as needed. Unfortunately, we have not been successful in getting any of them to show up in the item on the APEX page.
    As far as we can tell, we have the SSL/OHS/Certs configured, but may be there is another SSL directive or some other configuration item that we've missed that needs to be set in order for SSL CGI environment variables to be available to the owa_util.get_cgi_env function. If anyone can tell us what we may have missed, it would be appreciated.
    thanks
    bob

    Hey John,
    what we have found that we were not sure of is that we need to use Rewrite rules and conditions in the ssl.conf to grab the ssl cgi environment variables and "put" them into the request header to hold them like this:
    RewriteCond %{SSL:SSL_SERVER_S_DN} (.*)
    RewriteRule .* - [E=SSLS_DN:%1]
    RequestHeader add X-SSL-SERVER-S-DN %{SSLS_DN}e
    Then in the dads.conf put the request header reference in there with the plsqlcgienvironmentlist parameter like this:
    PlsqlCGIEnvironmentList HTTP_X_SSL_SERVER_S_DN
    Restart the OHS, and then grab the HTTP_X_SSL_SERVER_S_DN variable(s) via the owa_util.get_cgi_env in the APEX page to pull the value out with an anonymous block in an On Load - Before Header process like this:
    DECLARE
    lUserName VARCHAR2(100);
    BEGIN
    SELECT NVL(owa_util.get_cgi_env('HTTP_X_SSL_SERVER_S_DN'),'NOTHING HERE') INTO lUserName FROM DUAL;
    END;
    It's the Rewrite rules and putting them into the request header that we were not totally sure about as far as how and where you put the environment variables to make them accessible to the dads.conf with the PlsqlCGIEnvironmentList parameter that in turn makes them accessible to APEX. We're still not 100% sure this is the correct method, but it's working. We don't recall reading in any of the APEX docs, APEX forum threads, or other documentation about needing Rewrite rules and conditions to put the cgi environment variables into the request header to make them accessible to APEX. So, that seems to be our missing piece of the puzzle here.
    Anyway, I think we're okay for the moment, and may be this thread will help someone else out in the future. Thanks for your help John, and will give you a helpful plug on the forum for this thread. BTW, I do have your book, so it was nice to see someone as advanced with APEX as yourself reply to the posting.
    Thanks
    Bob

Maybe you are looking for

  • How to use the internal table of the submitted program

    Hi, In the main program i have submitted a program and that program is running  successfully and data is populated in to it_final, now i want to use this data populated internal table it_final in my main program. Thanks, Sudhakar.

  • Report Formatting Conditions

    I have a report based on a table that has 2 columns (start_time and end_time). I would like to change the background color if the systime is between start_time and end_time. I don't see a way to specify multiple conditions in the formatiing options.

  • Line wrapping and scrolling in JPanel

    Hello, I've got an empty JPanel to which I want to add an (unknown) number of JLabels. Each JLabel has a text which is just one word. When my program is adding JLabels to the JPanel, I want it to have the same behaviour as a normal text editor: when

  • Restarting takes ages

    I am developing using Portal 4.0 and am finding myself for one reason or another having to restart the server quite frequently. As in vain it seams the only way to get some changed take affect. I am starting it using the supplied batch file startPort

  • How to fix "Project or Library file is corrupt"

    Last Time I close the my project, then I want to reopen it, but popup a window "Project or Library file is corrupt" Can this corrupt project file can be fix? Because It contain too much information of this project. By the way, the project file size i