У меня есть два JSP файла:
index.jsp
(без тегов Struts 2) login.jsp
(с тегами Struts 2)
Я связался с login.jsp
до index.jsp
с тегом <a href="login.jsp">LOGIN IN</a>
.
При нажатии страница не загружается, вместо этого выдает ошибку:
(ERROR:org.apache.jasper.JasperException: The Struts dispatcher cannot be found.).
Если все метки стоек удалены из login.jsp
, все работает нормально.
web. xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
Как запустить мое приложение с тегами Struts 2?