Publish Static Content to WebLogic
By James Taylor on Jun 07, 2010
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.
- 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.
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-web-jar.dtd">
- Login to the WebLogic console to deploy application
- Click on Deployments
- Click on Lock & Edit
- Click Install and upload the war file downloaded in step 2
- Leave default "Install this deployment as an application" and click Next
- Select a Managed Server to deploy to and click Next
- Accept the defaults and click Finish
- Deployment completes successfully, now click the Activate Changes
- You should now see the application started in the deployments
- You can now access your static content via the following URL