Getting system Variables

Hi. I'm creating jsp page, which uses ssl connection. I want to print information of user logged into page, but I can't understand - how to get system variables in JSP page?
directory httpd.conf file:
<Files ~ "\.(cgi|shtml|php)$">
SSLOptions StdEnvVars ExportCertData
</Files>
# ExportCertData
When this option is enabled, additional CGI/SSI environment variables are created: SSL_SERVER_CERT, SSL_CLIENT_CERT and SSL_CLIENT_CERT_CHAINn (with n = 0,1,2,..). These contain the PEM-encoded X.509 Certificates of server and client for the current HTTPS connection and can be used by CGI scripts for deeper Certificate checking. Additionally all other certificates of the client certificate chain are provided, too. This bloats up the environment a little bit which is why you have to use this option to enable it on demand.
For example, I want to get SSL_CLIENT_CERT variable. How should I do it?

Did you tried
System.getProperty("");
Just check if it works for you.

Similar Messages

  • How can i get system variable using java

    Hi,
    I just want to know how can i get system variables using java code.
    for example i want to get the the date for today or i want to get the number of processes that's running.
    Thanks alot

    Hi,
    I just want to know how can i get system variables
    using java code.
    for example i want to get the the date for today or i
    want to get the number of processes that's running.
    Thanks alotSome generic "system variables" are available though Java, usually through the System class.
    Date today = new Date();
    is instantiated with the current date and time.
    Other system values, like environment values, should be passed to java through the command line (-D option) by setting system properties.
    Finally, platform specific values like the number of processes running will have to be written in platform specific code and executed by JNI (java native interface).
    Java is platform or system agnostic. Common system values, like time, are implemented. Hopefully you won't need platform specific values.

  • Getting system-variable folder

    Hi,
    I have a little problem, I hope somebody can help me.
    If I have a system-variable (on WindowsXP), e.g. JBOSS_HOME, that points to the root folder of my JBoss installation, how can I get access in a Java-program to it, so I can access a file, that is placed in a folder like that:
    JBOSS_HOME/folder1/folder2/file.txt
    when there is:
    JBOSS_HOME = C:/jboss
    Thanks for your help
    OLLI

    You can't really get at ... actuall the phrase is "Environment variables" directly.
    The equivalent in java is system properties, accessed through System.getProperty() but you have to define them on the java command line.
    However in windows you always have to have a command line stored somewhere anyway. You should be able to modify it to something like:
    javaw -Djboss.home=%JBOSS_HOME% -jar myapp.jar
    This will often be in the application shortcut properties. Then you can get the value with System.getProperty("jboss.home");

  • Get system variable and execute a Java Script

    I'm not sure it is the appropriate forum to ask this
    question. I'm using Captivate 2 without LMS.
    I need to execute a java script that take read a system
    variable (eg. USERNAME) and opens an URL using the USERNAMe as
    parameter. The idea here is to update a database opening a specific
    URL for a specific USERNAME.
    Any one has an example to do something similar ?

    Hello All,
    Could anyone please help me with some examples or
    tutorials how I can create Java Applet to run telnet
    to UNIX and execute a shell script?
    Presumably you don't need to write the telnet code yourself (like for a class.)
    If so then you can use this...
    http://jakarta.apache.org/commons/net/
    There might be some other dependencies from other commons stuff that you will need to resolve to run it.
    Once you have that, presumably you are not telnetting back to the source of the applet. If so you will need to deal with security for the applet. Usually that means that you must sign the applet. Otherwise you will have to modify the policy file on each client machine that will run the applet.

  • How do I get system variable of current process id?

    For example:
    select my_process_id from something.
    to know what's the id of running job itself?

    Use this:
    select sid from v$session
    where audsid=userenv 'sessionid');
    Tom Best

  • System build-in or system variable to get number of records from a query

    Hi,
    Is there a system build-in or system variable to get number of records from a Oracle Forms query?
    Thank you

    Namely, when GO_BLOCK(BLOCK_NAME) EXECUTE QUERY finishes, is there a way directly get the number of the records?
    SYSTEM.COURSOR_RECORD = 1 tells this is the first record
    SYSTEM.LAST_RECORD = 'TRUE' tells this is the last record
    Thanks

  • How to get system Environment variable?

    How to get system Environment variable without using jni?
    just like "JAVA_HOME" or "PATH"...
    Any reply is help to me!! :-)

    Thx for your reply...
    I get it!!!
    Read environment variables from an application
    Start the JVM with the "-D" switch to pass properties to the application and read them with the System.getProperty() method. SET myvar=Hello world
    SET myothervar=nothing
    java -Dmyvar="%myvar%" -Dmyothervar="%myothervar%" myClass
    then in myClass String myvar = System.getProperty("myvar");
    String myothervar = System.getProperty("myothervar");
    This is useful when using a JAVA program as a CGI.
    (DOS bat file acting as a CGI) java -DREQUEST_METHOD="%REQUEST_METHOD%"
    -DQUERY_STRING="%QUERY_STRING%"
    javaCGI
    If you don't know in advance, the name of the variable to be passed to the JVM, then there is no 100% Java way to retrieve them.
    NOTE: JDK1.5 provides a way to achieve this, see this HowTo.
    One approach (not the easiest one), is to use a JNI call to fetch the variables, see this HowTo.
    A more low-tech way, is to launch the appropriate call to the operating system and capture the output. The following snippet puts all environment variables in a Properties class and display the value the TEMP variable. import java.io.*;
    import java.util.*;
    public class ReadEnv {
    public static Properties getEnvVars() throws Throwable {
    Process p = null;
    Properties envVars = new Properties();
    Runtime r = Runtime.getRuntime();
    String OS = System.getProperty("os.name").toLowerCase();
    // System.out.println(OS);
    if (OS.indexOf("windows 9") > -1) {
    p = r.exec( "command.com /c set" );
    else if ( (OS.indexOf("nt") > -1)
    || (OS.indexOf("windows 2000") > -1 )
    || (OS.indexOf("windows xp") > -1) ) {
    // thanks to JuanFran for the xp fix!
    p = r.exec( "cmd.exe /c set" );
    else {
    // our last hope, we assume Unix (thanks to H. Ware for the fix)
    p = r.exec( "env" );
    BufferedReader br = new BufferedReader
    ( new InputStreamReader( p.getInputStream() ) );
    String line;
    while( (line = br.readLine()) != null ) {
    int idx = line.indexOf( '=' );
    String key = line.substring( 0, idx );
    String value = line.substring( idx+1 );
    envVars.setProperty( key, value );
    // System.out.println( key + " = " + value );
    return envVars;
    public static void main(String args[]) {
    try {
    Properties p = ReadEnv.getEnvVars();
    System.out.println("the current value of TEMP is : " +
    p.getProperty("TEMP"));
    catch (Throwable e) {
    e.printStackTrace();
    Thanks to W.Rijnders for the W2K fix.
    An update from Van Ly :
    I found that, on Windows 2003 server, the property value for "os.name" is actually "windows 2003." So either that has to be added to the bunch of tests or just relax the comparison strings a bit: else if ( (OS.indexOf("nt") > -1)
    || (OS.indexOf("windows 2000") > -1 )
    || (OS.indexOf("windows 2003") > -1 ) // works but is quite specific to 2003
    || (OS.indexOf("windows xp") > -1) ) {
    else if ( (OS.indexOf("nt") > -1)
    || (OS.indexOf("windows 20") > -1 ) // probably is better since no other OS would return "windows" anyway
    || (OS.indexOf("windows xp") > -1) ) {
    I started with "windows 200" but thought "what the hell" and made it "windows 20" to lengthen its longivity. You could push it further and use "windows 2," I suppose. The only thing to watch out for is to not overlap with "windows 9."
    On Windows, pre-JDK 1.2 JVM has trouble reading the Output stream directly from the SET command, it never returns. Here 2 ways to bypass this behaviour.
    First, instead of calling directly the SET command, we use a BAT file, after the SET command we print a known string. Then, in Java, when we read this known string, we exit from loop. [env.bat]
    @set
    @echo **end
    [java]
    if (OS.indexOf("windows") > -1) {
    p = r.exec( "env.bat" );
    while( (line = br.readLine()) != null ) {
    if (line.indexOf("**end")>-1) break;
    int idx = line.indexOf( '=' );
    String key = line.substring( 0, idx );
    String value = line.substring( idx+1 );
    hash.put( key, value );
    System.out.println( key + " = " + value );
    The other solution is to send the result of the SET command to file and then read the file from Java. ...
    if (OS.indexOf("windows 9") > -1) {
    p = r.exec( "command.com /c set > envvar.txt" );
    else if ( (OS.indexOf("nt") > -1)
    || (OS.indexOf("windows 2000") > -1
    || (OS.indexOf("windows xp") > -1) ) {
    // thanks to JuanFran for the xp fix!
    p = r.exec( "cmd.exe /c set > envvar.txt" );
    // then read back the file
    Properties p = new Properties();
    p.load(new FileInputStream("envvar.txt"));
    Thanks to JP Daviau
    // UNIX
    public Properties getEnvironment() throws java.io.IOException {
    Properties env = new Properties();
    env.load(Runtime.getRuntime().exec("env").getInputStream());
    return env;
    Properties env = getEnvironment();
    String myEnvVar = env.get("MYENV_VAR");
    To read only one variable : // NT version , adaptation for other OS is left as an exercise...
    Process p = Runtime.getRuntime().exec("cmd.exe /c echo %MYVAR%");
    BufferedReader br = new BufferedReader
    ( new InputStreamReader( p.getInputStream() ) );
    String myvar = br.readLine();
    System.out.println(myvar);
    Java's System properties contains some useful informations about the environment, for example, the TEMP and PATH environment variables (on Windows). public class ShowSome {
    public static void main(String args[]){
    System.out.println("TEMP : " + System.getProperty("java.io.tmpdir"));
    System.out.println("PATH : " + System.getProperty("java.library.path"));
    System.out.println("CLASSPATH : " + System.getProperty("java.class.path"));
    System.out.println("SYSTEM DIR : " +
    System.getProperty("user.home")); // ex. c:\windows on Win9x system
    System.out.println("CURRENT DIR: " + System.getProperty("user.dir"));
    Here some tips from H. Ware about the PATH on different OS.
    PATH is not quite the same as library path. In unixes, they are completely different---the libraries typically have their own directories. System.out.println("the current value of PATH is: {" +
    p.getProperty("PATH")+"}");
    System.out.println("LIBPATH: {" +
    System.getProperty("java.library.path")+"}");
    gives the current value of PATH is:
    {/home/hware/bin:/usr/local/bin:/usr/xpg4/bin:/opt/SUNWspro/bin:/usr/ccs/bin:
    /usr/ucb:/bin:/usr/bin:/home/hware/linux-bin:/usr/openwin/bin/:/usr/games/:
    /usr/local/games:/usr/ccs/lib/:/usr/new:/usr/sbin/:/sbin/:/usr/hosts/:
    /usr/openwin/lib:/usr/X11/bin:/usr/bin/X11/:/usr/local/bin/X11:
    /usr/bin/pbmplus:/usr/etc/:/usr/dt/bin/:/usr/lib:/usr/lib/lp/postscript:
    /usr/lib/nis:/usr/share/bin:/usr/share/bin/X11:
    /home/hware/work/cdk/main/cdk/../bin:/home/hware/work/cdk/main/cdk/bin:.}
    LIBPATH:
    {/usr/lib/j2re1.3/lib/i386:/usr/lib/j2re1.3/lib/i386/native_threads:
    /usr/lib/j2re1.3/lib/i386/client:/usr/lib/j2sdk1.3/lib/i386:/usr/lib:/lib}
    on my linux workstation. (java added all those execpt /lib and /usr/lib). But these two lines aren't the same on window either:
    This system is windows nt the current value of PATH is:
    {d:\OrbixWeb3.2\bin;D:\jdk1.3\bin;c:\depot\cdk\main\cdk\bin;c:\depot\
    cdk\main\cdk\..\bin;d:\OrbixWeb3.2\bin;D:\Program
    Files\IBM\GSK\lib;H:\pvcs65\VM\win32\bin;c:\cygnus
    \cygwin-b20\H-i586-cygwin32\bin;d:\cfn\bin;D:\orant\bin;C:\WINNT\system32;C:\WINNT;
    C:\Program Files\Dell\OpenManage\Resolution Assistant\Common\bin;
    d:\Program Files\Symantec\pcAnywhere;
    C:\Program Files\Executive Software\DiskeeperServer\;C:\Program Files\Perforce}
    LIBPATH:
    {D:\jdk1.3\bin;.;C:\WINNT\System32;C:\WINNT;d:\OrbixWeb3.2\bin;D:\jdk1.3\bin;
    c:\depot\cdk\main\cdk\bin;c:\depot\cdk\main\cdk\..\bin;
    d:\OrbixWeb3.2\bin;D:\Program Files\IBM\GSK\lib;
    H:\pvcs65\VM\win32\bin;c:\cygnus\cygwin-b20\H-i586-cygwin32\bin;d:\cfn\bin;
    D:\orant\bin;C:\WINNT\system32;
    C:\WINNT;C:\Program Files\Dell\OpenManage\ResolutionAssistant\Common\bin;
    d:\Program Files\Symantec\pcAnywhere;
    C:\Program Files\Executive Software\DiskeeperServer\;C:\Program Files\Perforce}

  • System variables in R/3 when badi is triggered from portal

    Hi,
       How can we know the action from the portal,i mean from the create expense report i want to throw an error message if the user press "Review" button based on my validation. i have written in the badi,but when the user press "Previous step" button also this badi is getting triggered and as per the validation it is throwing an error message, i cannot go back. Are there any system variables that we can capture which button he pressed from the portal so that i can control to throw an error message only when the user press "Review" button.
    Thanks & Regards,
    Anil kumar

    Resolved

  • System variables in R/3 for the action from the portal

    Hi,
    How can we know the action from the portal,i mean from the create expense report i want to throw an error message if the user press "Review" button based on my validation. i have written in the badi,but when the user press "Previous step" button also this badi is getting triggered and as per the validation it is throwing an error message, i cannot go back. Are there any system variables that we can capture which button he pressed from the portal so that i can control to throw an error message only when the user press "Review" button.
    Thanks & Regards,
    Anil kumar

    Resolved

  • How can I get the variable with the value from Thread Run method?

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    // I should get Inside the run method::: But I get only Inside
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    We want to access a variable from the run method of a
    Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
    Even
    though I make the variable as public /public static, I
    could get the value till the end of the run method
    only. After that scope of the variable gets lost
    resulting to null value in the called method/class..
    I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
    public class SampleSynchronisation
      public static void main(String[] args)
        SampleSynchronisation app = new SampleSynchronisation();
      public SampleSynchronisation()
        MyRunnable runner = new MyRunnable();
        new Thread(runner).start();
        // yield this thread so other thread gets a chance to start
        Thread.yield();
        System.out.println("runner's X = " + runner.getX());
      class MyRunnable implements Runnable
        String X = null;
        // this method called from the controlling thread
        public synchronized String getX()
          return X;
        public void run()
          System.out.println("Inside MyRunnable");
          X = "MyRunnable's data";
      } // end class MyRunnable
    } // end class SampleSynchronisation>
    public class SampleSynchronisation
    public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run
    method "+sathr.x);
    // I should get Inside the run method::: But I get
    only Inside
    class sampleThread extends Thread
    public String x="Inside";
    public void run()
    x+="the run method";
    NB: if i write the variable in to a file I am able to
    read it from external method. This I dont want to do

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • System variables not showing correctly in body pages

    Can anyone help with a problem I'm having with system variables please?
    I have created a template and multiple documents which all use a system variable for placing the chapter number and page number in the footer: <$chapnum>-<$curpagenum>
    I have just created a new document and want to use the same variable on the main pages of the document but I want to use a different page number variable on the TOC. For some reason now, when I create a new variable of <$curpagenum> it doesn't show correctly on the document; it's showing as: <$curpagenum
    I've also tried using the format of <$chapnum>-<$curpagenum> that has worked on other documents but now this shows in the document footer as: <$chapnum<$curpagenum
    Has anyone seen this problem before?
    Thanks

    Hi Art, thanks for the reply.
    In my original documents I'd edited the Current Page system variable from <$curpagenum> to <$chapnum>-<$curpagenum>. This worked correctly.
    In the new document I tried both the picking-and-clicking method and typing the string to get the same footer but neither worked.
    I've now changed it as you suggested, selecting the two seperate system variables of <$chapnum> and then <$curpagenum> and this seems to have solved the problem.
    I'll know to keep things simple in future!
    Thanks.

  • System variable Quiz Score deducts points when lesson is re-opened (Capt 5.5 with Kallidus LMS)

    I'm trying to get to grips with quizing and reporting, particularly complete/incomplete to check content has been covered. I've set up a small test file that awards 1 point to each 'Next' button. The project works well in the LMS when completed in one go and if the user exits halfway through (LMS does report correctly as Incomplete 50%). The problem occurs when reopening the lesson it shows the score correctly for a moment then deducts points.
    I've also included a user variable in the project to keep score too. I've tried various options e.g. default data tracking, user can skip quiz, etc but the issue remains.
    Pictures below illustrate the problem
    First opened - Top score is user set variable, bottom is system variable cpQuizInfoPointsscored
    Halfaw and re-open - Completed course to halfway and both scores on lesson both at 5. Shut down lesson and re-opened. The system variable showed 5 for about one second then went to 4 whereas the user variable shows the 'correct' score of 5.
    I've looked at the debug file for the LMS and can see that it seems to be behaving as it should i.e calling for postion scores etc and they are correct. Any help appreciated!

    HI Loveesh,
    There’s no recorded content, I just started a new blank project (so no leftovers from other projects either). The problem occurs in the Kallidus LMS imported as scorm 1.2 package.
    Also, finally got it to work in 'Reload Scorm Player' and the lesson acts the same way.
    Happy to share file with you, if you want to have a look it’s only 10 Slides @ 500KB.
    Cheers

  • System variable for find the method BOR / workflow

    Hi,
    I  am working with one workflow . I am displaying tcode FB60 in edit mode( FV60) for the approver( method FIPP.Change ). I wanted to differentiate technically the tcodes that are executing through manually and thorough BOR method.
    Is there any system variable which holds the value of BOR and method name ?
    Please help me in getting this system variable.
    Regards
    paveee

    Hi Claudio,
    Try this,
    ->> Open the Pick List(System) PLD and Save as the New PLD.
    ->> Open the NEw PLD and Create 1 Database Field(for WareHouse Name) in Repetetive Area.
    Table -> OWHS - WareHouse
    Column -> WhsName - WareHouse Name
    Save as and Run the Print Preview.
    IF will not print the WareHouse Name in Print.
    Do this in PLD.
    ->> Open your PLD.
    --> Ralate to WareHouse Code Field ID in WareHouse Name Field at Content Tab on Properties Window.
    Regards,
    Madhan.

  • Can an embedded Flash SWF save and get a variable with Reader?

    My SWF content contains text in different languages.  The user selects a language and it appears.
    Is there a way to store this setting locally so that the correct language appears when the pdf is reopened?
    I only need a two-letter string, like "EN," "FR," "ZH," etc. and the SWF does the rest.
    I've tried calling multimedia_saveSettingsString from the SWF Actionscript, and I've tried setting an Acrobat global variable and setPersistent using Actionscript and local .js files. It works in Acrobat, but not Reader on a users system.
    I also tried using a separate pdf form to store a global variable, and then attempted to get that variable using the SWF Actionscript.
    Could the be an issue with security settings or Acrobat properties?
    I'm not a virtuoso at this, so script examples would help.
    (Windows 7; Actionscript 3; Acrobat 9 and XI are available; Adobe Reader 9 is in the installed base, but I may be able to switch to a higher version of Reader)
    I asked a similar question in the Acrobat Javascript community, but got no responses. I reworded it here with additional detail
    Thanks.

    Here's the section from my example that's linked to the Save and Load buttons. evalText, infoText and replyText are the three TextArea fields.
    Note that it's important to send a string, but return an object and cast it back into a string. EI.call() has no clue what's being sent back from JavaScript.
    // button handlers
    butSave.addEventListener(MouseEvent.CLICK, doSave);
    function doSave(e:MouseEvent):void {
        var rtn:Object = ExternalInterface.call("multimedia_saveSettingsString",evalText.text);
        if (rtn == null) {
            infoText.appendText("Save: REPLY = null");
        } else if (rtn.toString() == "") {
            infoText.appendText("Save: REPLY = empty string");
        } else replyText.appendText("Save: reply = " + rtn.toString());
    butLoad.addEventListener(MouseEvent.CLICK, doLoad);
    function doLoad(e:MouseEvent):void {
        var rtn:Object = ExternalInterface.call("multimedia_loadSettingsString");
        if (rtn == null) {
            infoText.appendText("Load: REPLY = null");
        } else if (rtn.toString() == "") {
            aT(infoText,"Load: REPLY = empty string");
        } else replyText.appendText("Load: reply = " + rtn.toString());

Maybe you are looking for

  • Report Preview Issues SLM 1.2

    I am having an issue with the connection check completing sucessfully. I have updated all of the jar files in the build directory with the versions from the SLM lib directory. The configuration file exists and is in that location (I have included the

  • Statspack problem

    Hi Everyone Please Help me Regarding the Oracle9i statspack Problem is that ,when i start the first script spreport.sql this report requried the snap no ,after this script when i start second script sprepsql.sql this report also want snap no ,after t

  • Unable to open windows region

    Hi, I have been trying to change my windows region in Windows  8.1, but the program will not open from the control panel icon or the taskbar search. This is making it very difficult to install other updates, many of which are region dependent. Has an

  • Skin state problem with PopupAnchor

    I wanted a button which on hover show a popup. and depending on some state, add/remove elements from the popup. I extended Button to create HoverButton and used DropDownController with PopupAnchor to get the hover to popup behavior. However for some

  • What is a software patch

    what is a software patch