alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat partsearchinput.jsp
<%@ taglib prefix="s" uri="/struts-tags"%> <s:actionerror/> <s:form action="partsearchinput"> <s:textfield name="partid" label="partid"/> <s:submit value="search"/> </s:form> the above code works, and verified by http://localhost/ecommerce/partsearchinput.jsp but, after i start to use sitemesh, it has the problem as the following The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location] SEVERE: Unhandled exception occurred whilst decorating page java.lang.RuntimeException: org.apache.jasper.JasperException: An exception occurred processing JSP page /partsearchinput.jsp at line 6 3: 4: <%@ taglib prefix="s" uri="/struts-tags"%> 5: 6: <s:actionerror/> 7: <s:form action="partsearchinput"> 8: <s:textfield name="partid" label="partid"/> 9: <s:submit value="search"/> **************************************************************************** alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF # cat web.xml <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter </filter-class> </filter> <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping> ********************************************************************** alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/decorators # cat basic-theme.jsp <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%> <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%> <%@ taglib prefix="s" uri="/struts-tags"%> <body> <table width="100%" height="100%"> <tr> <td> <%@ include file="/partsearchinput.jsp"%> </td></tr> <tr> <td> <decorator:body /> <hr /> </td></tr> <tr> <td> <h2> <p><font color=blue>Copyright XXXXX</font></p> </h2> </td></tr> </table> </body> ******************************************************************************* alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF # cat decorators.xml <decorators defaultdir="/decorators"> <decorator name="basic-theme" page="basic-theme.jsp"> <pattern>/menu.jsp</pattern> </decorator> </decorators> ********************************************************************************** alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat partsearchinput.jsp <%@ taglib prefix="s" uri="/struts-tags"%> <s:actionerror/> <s:form action="partsearchinput"> <s:textfield name="partid" label="partid"/> <s:submit value="search"/> </s:form> *********************************************************************************** alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat menu.jsp <body> <h1>test</p> </body>