Detailed error message:
Unable to load config Class.cn.itcast.shop.interceptor.PrivilegeInterceptor at interceptor
file:/myeclipse/.xxx/web-inf/classes/struts.xml:13:102
Probably due to a missing jar, which might is fine if you never plan to use the Privilegeinterceptor interceptor about Jars Package
(1) The error message shows a missing jar package, and the following are all the jar packs that are configured by the Structs2.3.2 version.
Asm-3.3.jar
Asm-commons-3.3.jar
Asm-tree-3.3.jar
Commons-fileupload-1.3.1.jar about file Downloads
Commons-io-2.2.jar File Download
Commons-lang3-3.2.jar
Commons-loggin-1.1.3.jar Log Management
Freemarker-2.3.22.jar Presentation Layer framework, defines the Struts2 visual component theme
Javassist-3.11.0.ga.jar
Ognl-3.0.6.jar OGNL expression Language, Struts2 supports the El
Core Library of Strut2-core-2.3.24.1.jar Struts2
Xwork-core-2.3.24.1.jar WebWork's core library, Nature needs its support
Jar package must be complete, otherwise tomcat boot will have 500 error codes
(2) The following 6 are STRUCTS2 use the interceptor necessary jar pack, check that there is no less.
about Configuration
Registration information in Structs.xml:
<!--Configure Custom Interceptor-->
<interceptors>
<interceptor name= "Privilegeinterceptor" class= Cn.itcast.shop.interceptor.PrivilegeInterceptor "/>
</interceptors>
<!--Configure the back-level category action- >
<action name= "admincategory_*" class= "admincategoryaction" method= "{1}" >
<result name= " FindAll ">/admin/category/list.jsp</result>
<!--reference Interceptor-->
<interceptor-ref name=" Privilegeinterceptor "/>
<interceptor-ref name= defaultstack"/>
</action>
The correct wording:
<!--in Spring Register Interceptor-->
<bean id= "Privilegeinterceptor" class= " Cn.itcast.shop.interceptor.PrivilegeInterceptor "scope=" prototype ">
</bean>
<!--structs Configure custom interceptors-->
<interceptors>
<interceptor name= "Privilegeinterceptor" class= " Privilegeinterceptor "/>
</interceptors>
Summary:
The lead jar package must be quoted. The implementation of the custom interceptor is not difficult to understand, we first wrote a Privilegeinterceptor class, and then because the SSH framework is used here, class creation is first given to spring management, So you can't register directly in Structs.xml, you should now register in spring.
Note that the IDs registered in spring correspond to the Name,class and name in structs and do not write the original path.