我在添加<s:fielderror name="account"></s:fielderror>这段代码后,访问login.jsp报错HTTP Status 500 - The Struts dispatcher cannot be found.后来在网上搜索了一下,在web.xml加入
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>这段代码就可以了,网上说是之前不能直接通过jsp访问。出现相同问题的小伙伴可以试一下
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>这段代码就可以了,网上说是之前不能直接通过jsp访问。出现相同问题的小伙伴可以试一下
2017-08-08
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
2017-08-06
强烈推荐大家使用IntelliJ IDEA不用自己导包,方便得多,我倒腾了一天eclipse都没跑起来,IntelliJ IDEA用了一会就跑起来了
2017-08-02
eclipse+struts2.5.10.1
https://github.com/hgbssh/FirstStruts2/
https://github.com/hgbssh/FirstStruts2/
2017-07-31
我们都是在web.xml配置的
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
2017-07-29