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:
... <listener> <description>Escenic Forum Presentation layer bootstrap listener</description> <listener-class>com.escenic.forum.presentation.servlet.PresentationBootstrapper</listener-class> </listener> ... <!-- 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, /WEB-INF/struts-config-forum.xml, /WEB-INF/struts-config-profile.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:
com.escenic.forum.presentation.servlet.PresentationBootstrapper
-
This listener definition must be added somewhere in the file (preferably alongside any other listener definitions).
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, /WEB-INF/struts-config-forum.xml, /WEB-INF/struts-config-profile.xml
-
The paths of the Struts configuration files to be used, described below. You will need at least to specify
struts-config,xml
andstruts-config-forum.xml
.struts-config-profile.xml
is only needed if your publication is to require forum user registration and login. Note also that Escenic's Viz Community Expansion provides an alternative and more flexible means of providing user registration functionality - it allows users to log in using credentials they already have, such as Google or Facebook credentials.
Several Escenic plug-ins use Struts, so the publication
web.xml
file may already contain some of the
above code, in which case you do not need to add it again.