The Struts dispatcher cannot be found. This are 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 Dispatche R needed for this tag. -[Unknown Location]
At Org.apache.struts2.views.jsp.TagUtils.getStack (tagutils.java:60)
At Org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack (strutsbodytagsupport.java:44)
The original use of labels, the reference method is the default configuration:
Web.xml: <filter> <filter-name>struts2</filter-name> <filter-class> Org.apache. Struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <f Ilter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Reference in page: <%@ taglib prefix= "s" uri= "/struts-tags"%>
Due to the relationships of some special applications in the Web application used, the Web.xml configuration is changed to: <filter> <filter-name>struts2</filter-name> <FILTER-CLA ss> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <taglib > <taglib-uri>struts-tags</taglib-uri> <taglib-location>/web-inf/struts2-core-2.0.11.jar </taglib-location> </taglib> <filter-mapping> <FILTER-NAME>STRUTS2</FILTER-NAME&G T <url-pattern>/*.action</url-pattern> </filter-mapping>
Let the Sturts filter accept only the suffix name Action request and configure the Struts tab to the Web.xml file.
In use, however, direct access to index.jsp occurs with an exception: the Struts dispatcher cannot be found. This are usually caused by using Struts tags without the associated filter. Strut s tags are only usable while the request has passed through its servlet filter, which initializes the Struts Dispa Tcher n eeded for this tag. -[Unknown Location]
Cannot use JSP directly in Struts2, reference struts2 label. Is there a way to solve it?
To find a solution, in fact, just add a filter settings on it: <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*.action</url-pattern> </filter- Mapping>