Table of Contents

Weblogic - Static Web Site Deployment

About

Java - Web Application (Web Module) - War in Weblogic

How to deploy a static website in Weblogic.

Steps

Create a Web Archive

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
 
    <display-name>My Web Site Name</display-name>
 
    <description>
       A static web site
    </description>
 
    <welcome-file-list>
       <welcome-file>index.html</welcome-file>
    </welcome-file-list>
 
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
	<context-root>WebSiteName</context-root>
</weblogic-web-app>
WEB_SITE_ROOT
  - page1.html
  - page2.html
  - script.js
  - ...........
  - WEB-INF
      - web.xml
      - weblogic.xml

cd $WEB_SITE_ROOT
jar cvf path\to\myWarFile.war .

Deploy the Web Site into Weblogic

To deploy web application into weblogic, you use the weblogic.Deployer (See doc )

java ^ 
  -cp "C:\fmw\wlserver\server\lib\weblogic.jar" ^
  weblogic.Deployer ^
  -undeploy ^
  -name myWebSite ^
  -username weblogic ^
  -password welcome1 ^
  -adminurl t3://localhost:9500
java ^ 
  -cp "C:\fmw\wlserver\server\lib\weblogic.jar" ^
  weblogic.Deployer ^
  -deploy ^
  -name myWebSite ^
  -username weblogic ^
  -password welcome1 ^
  -adminurl t3://localhost:9500
  -source path\to\myWebSite.war
REM You can also specified the target server with the targets options
REM   -targets bi_server1

Verification

The application can be seen in the weblogic console. Console > Deployment

If you open a browser and go to the following URL, you should see your website as you defined the index in the web.xml file

http://localhost:portOfTarget/context-root

Example: http://localhost:9500/myWebSite

Weblogic Index Static Website