Oracle Blog

Discussions and Examples using Oracle Fusion Middleware

Publish Static Content to WebLogic

This post has been updated to provide a more flexible approach to deploying static content 16.07.2012.

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.

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

mkdir /home/oracle/html

Download the war file here. This file creates a simple web app to expose the files.

In the war file you will see a directory WEB-INF, inside there you will see 2 files, web.xml, and weblogic.xml. There is no need to edit these files but if you want to change the context or the directory edit the weblogic.xml file to match your environment.

This solution should apply automatically, i.e. load a html document under the document root in my instance it is /home/oracle/html. That document will be accessible to users automatically, there is not need to stop and start the app.