mixing ssl and non ssl jsp pages. - Weblogic

This is a discussion on mixing ssl and non ssl jsp pages. - Weblogic ; Hi, I am new to Weblogic 8.1 and I would like to learn how to setup few jsp pages in https:// and few pages to be served in http:// protocol. I have created a managed server using 7004 for http ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: mixing ssl and non ssl jsp pages.

  1. mixing ssl and non ssl jsp pages.

    Hi,
    I am new to Weblogic 8.1 and I would like to learn how to setup few jsp pages in https:// and few pages to be served in http:// protocol.

    I have created a managed server using 7004 for http and 7040 for https. Currently I have 2 jsp pages index.jsp and test.jsp and both the pages can be accessed using http:// or https://

    I wanted to make test.jsp work only with https:// and not work with http:// How do I configure this?

    In realtime webapplications. How is switching of http and https working? Are the URL's hard coded in the controller servlet?

    Some tips would be helpful.

    Uma

  2. Re: mixing ssl and non ssl jsp pages.

    Hi,

    To do this task do the following,
    1. Create a property file in your application. for example let us take myapp.properties
    2. include the following to the myapp.properties file

    #
    #sslport=7002
    #nonsslport=7001
    #serverip=127.0.0.1
    #ctpath=myApp
    #
    # In your case
    sslport=7004
    nonsslport=7040
    serverip=127.0.0.1
    # ctpath is the web deployment directory
    ctpath=yourapp

    3. Create a class to read the property file say PropertyReader.java and implement the following

    String sslport=Properties.getProperty("sslport");
    String nonssl=Properties.getProperty("nonsslport);
    String serverip=Properties.getProperty("serverip);
    String cpath=Properties.getProperty("ctpath");

    4. initialise the propertyReader class and
    in the property class keep following variables in admin session data

    String sslpath="https://"+serverip+":"+sslport+"/"+cpath
    String nonsslpath="http://"+serverip+":"+nonsslport+"/"+cpath

    5. use these variables for ssl or nonssl

    response.senRedirect(sslpath+"/bank.jsp"); //for ssl

    response.sendRedirect(nonsslpath+"/welcome.jsp"); //for non ssl

    like the same way

    Regards,

    Nishant Kulkarni

+ Reply to Thread