After <% @ taglib prefix = "s" uri = "/struts-tags" %> is added to the JSP page, the following error is displayed: Servlet. service () for servlet jsp threw exceptionThe 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] at org. apache. struts2.views. jsp. tagUtils. getStack (TagUtils. java: 60) at org. apache. struts2.views. jsp. strutsBodyTagSupport. getStack (StrutsBodyTagSupport. java: 44) at org. apache. struts2.views. jsp. componentTagSupport. doStartTag (ComponentTagSupport. java: 48) at org. apache. jsp. messageBoard. showMessage_jsp. _ jspx_meth_s_005fiterator_005f0 (showMessage_jsp.java: 148) at org. apache. jsp. messageBoard. showMessage_jsp. _ jspService (showMessage_jsp.java: 119) at org. apache. jasper. runtime. httpJspBase. service (HttpJspBase. java: 70) at javax. servlet. http. httpServlet. service (HttpServlet. java: 717) at org. apache. jasper. servlet. jspServletWrapper. service (JspServletWrapper. java: 374) at org. apache. jasper. servlet. jspServlet. serviceJspFile (JspServlet. java: 342) at org. apache. jasper. servlet. jspServlet. service (JspServlet. java: 267) at javax. servlet. http. httpServlet. service (HttpServlet. java: 717) at org. apache. catalina. core. applicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 290) at org. apache. catalina. core. applicationFilterChain. doFilter (ApplicationFilterChain. java: 206) at org. springframework. web. filter. characterEncodingFilter. doFilterInternal (CharacterEncodingFilter. java: 88) at org. springframework. web. filter. oncePerRequestFilter. doFilter (OncePerRequestFilter. java: 76) at org. apache. catalina. core. applicationFilterChain. internalDoFilter (ApplicationFilterChain. java: 235) at org. apache. catalina. core. applicationFilterChain. doFilter (ApplicationFilterChain. java: 206) at org. apache. catalina. core. standardWrapperValve. invoke (StandardWrapperValve. java: 233) at org. apache. catalina. core. standardContextValve. invoke (StandardContextValve. java: 191) at org. apache. catalina. core. standardHostValve. invoke (StandardHostValve. java: 128) at org. apache. catalina. valves. errorReportValve. invoke (ErrorReportValve. java: 102) at org. apache. catalina. core. standardEngineValve. invoke (StandardEngineValve. java: 109) at org. apache. catalina. connector. coyoteAdapter. service (CoyoteAdapter. java: 286) at org. apache. coyote. http11.Http11AprProcessor. process (Http11AprProcessor. java: 857) at org. apache. coyote. http11.Http11AprProtocol $ Http11ConnectionHandler. process (Http11AprProtocol. java: 565) www.2cto.com
At org.apache.tomcat.util.net. aprEndpoint $ Worker. run (AprEndpoint. java: 1509) at java. lang. thread. run (Thread. java: 619. add a filter to XML: [html] <span style = "font-size: 18px; "> <filter-mapping> <filter-name> struts2 </filter-name> <url-pattern> *. jsp </url-pattern> </filter-mapping> </span>