Publish Static Content to WebLogic

Posted by James Taylor on Oracle Blogs See other posts from Oracle Blogs or by James Taylor
Published on Wed, 09 Jun 2010 00:40:49 +1300 Indexed on 2010/06/08 12:03 UTC
Read the original article Hit count: 534

Filed under:

Most people know WebLogic has a built in web server. Typically this is not an issue as you deploy java applications and WebLogic publishes to the web. But what if you just want to display a simple static HTML page. In WebLogic you can develop a simple web application to display static HTML content.

In this example I used WLS 10.3.3. I want to display 2 files, an HTML file, and an xsd for reference.

  1. Create a directory of your choice, this is what I will call the document root.

    mkdir /u01/oracle/doc_root
  2. Copy the static files to this directory 
  3. In the document root directory created in step 1 create the directory WEB-INF

    mkdir WEB-INF
  4. In the WEB-INF directory create a file called web.xml with the following content
  5. <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "
    http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

    <web-app>
    </web-app>

  6. Login to the WebLogic console to deploy application
  7. Click on Deployments
  8. Click on Lock & Edit
  9. Click Install and set the path to the directory created in step 1

    image
  10. Leave default "Install this deployment as an application" and click Next

    image
  11. Select a Managed Server to deploy to and click Next

    image
  12. Accept the defaults and click Finish 
  13. Deployment completes successfully, now click the Activate Changes

    image
  14. You should now see the application started in the deployments

    image
  15. You can now access your static content via the following URL

    http://localhost:7001/doc_root/helloworld.html

    image

© Oracle Blogs or respective owner