Wednesday, July 21, 2010

Make an web application as root application in WebLogic

A customer's asking how to make a war application the root application.

I believe this should be documented, but unfortunately I couldn't find that(maybe I've missed something...).

But anyway, the solution is quiet simple:

- create or modify weblogic.xml under war file's WEB-INF directory
- set context-root to be "/"

sample weblogic.xml:


<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<wls:context-root>/</wls:context-root>
</wls:weblogic-web-app>