Editing web.xml

Every Escenic publication has a web.xml file in its WEB-INF folder. To enable Struts, web.xml must contain code like this:

<!-- Standard Action Servlet Configuration -->
<servlet>
  <servlet-name>action</servlet-name>
  <servlet-class>
    org.apache.struts.action.ActionServlet
  </servlet-class>
  <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
  </init-param>
  <init-param>
    <param-name>validate</param-name>
    <param-value>true</param-value>
  </init-param>
  <init-param>
    <param-name>locale</param-name>
    <param-value>true</param-value>
  </init-param>
  <load-on-startup>2</load-on-startup>
</servlet>

<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
</servlet-mapping>

The most important items in the above code are highlighted:

action

The name of the Struts action servlet. It is only used inside the web.xml file, so you can use any name you like. It must, however be the same in both places it appears.

org.apache.struts.action.ActionServlet

The name of the class that is to be used as the Struts action servlet. You should not in general change this line.

/WEB-INF/struts-config.xml

The path of the Struts configuration file, described below.

Several Escenic plug-ins use Struts, so the publication web.xml file may already contain the above code, in which case you do not need to add it again.