Resin-web.xml

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
(renamed tag to directive)
Line 1: Line 1:
 
[[Category:Configuration]]
 
[[Category:Configuration]]
  
The resin-web.xml file, located in WEB-INF, is the place to configure Resin-specific web-app configuration.  All the usual web.xml tags are supported as well as simplifying the web.xml syntax to make the configuration more readable.
+
The resin-web.xml file, located in WEB-INF, is the place to configure Resin-specific web-app configuration.  All the usual web.xml directives are supported as well as simplifying the web.xml syntax to make the configuration more readable.
  
 
Since most applications will only be deploying to a single web server, they will typically just create a resin-web.xml as the configuration file in WEB-INF.  Applications which expect to deploy in multiple web servers will generally create a web.xml with servlet-standard configuration and a separate resin-web.xml for additional configuration for databases and other resources.
 
Since most applications will only be deploying to a single web server, they will typically just create a resin-web.xml as the configuration file in WEB-INF.  Applications which expect to deploy in multiple web servers will generally create a web.xml with servlet-standard configuration and a separate resin-web.xml for additional configuration for databases and other resources.

Revision as of 20:23, 21 February 2006


The resin-web.xml file, located in WEB-INF, is the place to configure Resin-specific web-app configuration. All the usual web.xml directives are supported as well as simplifying the web.xml syntax to make the configuration more readable.

Since most applications will only be deploying to a single web server, they will typically just create a resin-web.xml as the configuration file in WEB-INF. Applications which expect to deploy in multiple web servers will generally create a web.xml with servlet-standard configuration and a separate resin-web.xml for additional configuration for databases and other resources.

For validation, the resin-web.xml should declare the Resin validation namespace: http://caucho.com/ns/resin. This will let Resin catch XML configuration errors early and give information about the errors.

resin-web.xml

<resin xmlns="http://caucho.com/ns/resin">
  <database ...>
  </database>

  <servlet>
    ...
  </servlet>

  <servlet-mapping>
    ...
  </servlet-mapping>
</resin>


Resin reads the web.xml and resin-web.xml in order, so configuration in the resin-web.xml can override the configuration in the web.xml.

Since Resin 3.0 tries to avoid defaults, the import of web.xml and resin-web.xml is defined in the conf/app-default.xml file as follows:

app-default.xml

<server xmlns="http://caucho.com/ns/resin"
        xmlns:resin="http://caucho.com/ns/resin/core">

<web-app-default>
  ...
  <resin:import path="WEB-INF/web.xml" optional="true"/>
  <resin:import path="WEB-INF/resin-web.xml" optional="true"/>
</web-app-default>
</server>
Personal tools