Friday, 13 April 2018

What is difference between web.xml and weblogic.xml?

The web.xml file provides configuration and deployment information for the Web components that comprise a Web application. Examples of Web components are servlet parameters, servlet and JavaServer Pages (JSP) definitions, and Uniform Resource Locators (URL) mappings. This is located in the WEB-INF directory.

Weblogic.xml is the configuration file for all the applications lying in the domain created. It lies in the META-INF directory and contains parameters such as auth-filter, charset-params, container-descriptor, context-root, description etc..

Web.xml is specific to Web applications (e.g. servlets) while weblogic.xml applies to all applications. Additionally, you need to put in weblogic.xml all settings that are vendor-specific. An example is connecting a security role with the actual user or group:
<security-role-assignment>
    <role-name>AdminRole</role-name>
    <principal-name>Fred</principal-name>
    <principal-name>Ted</principal-name>
</security-role-assignment>
Namely, Java EE does not specify how this mapping should be achieved. In Glassfish it is performed through glassfish-web.xml file, in Tomcat through tomcat-users.xml. One way or another, you need an additional deployment descriptor for a such task.

No comments:

Post a Comment

All about WebLogic t3 and t3s Protocol

WebLogic's  implementation of the RMI specification uses a proprietary protocol known as T3. You can think of T3 (and secure T3S) as a l...