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
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 /u01/oracle/doc_root - Copy the static files to this directory
- In the document root directory created in step 1 create the directory WEB-INF
mkdir WEB-INF - In the WEB-INF directory create a file called web.xml with the following content
- Login to the WebLogic console to deploy application
- Click on Deployments
- Click on Lock & Edit
- Click Install and set the path to the directory created in step 1
- 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
http://localhost:7001/doc_root/helloworld.html
<?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>
© Oracle Blogs or respective owner