Struts2.0 + spring intercepter cannot inject attributes

Source: Internet
Author: User

This problem has plagued me for one afternoon, but it is really tangled because it is not configured after the intercepter of struts2 is configured.

RedDefaultstack, ThisDefaultstackIt is well-designed and cannot be injected without it. RememberDefaultstackThe front and back of the interceptor cannot be reversed; otherwise, some content in the value stack on the page may not exist. For example, the content of addfielderror may be blank, which is a problem I encountered, hope to help you.

<Package name = "org" extends = "struts-Default" namespace = "/org">

<! -- Configure the filter for exception handling -->
<Interceptor name = "myexceptioninterceptor" class = "com. yy. intercepter. commexceptioninterceptor"> </interceptor>

<Interceptor-stack name = "mystack">
<Interceptor-ref name = "defaultstack"> </Interceptor-ref>
<Interceptor-ref name = "myexceptioninterceptor"> </Interceptor-ref>

<Action name = "org" class = "orgaction">
<! -- Call Interceptor -->
<Interceptor-ref name = "mystack"/>
<Result name = "success">/OrgN/index. jsp </result>
<Result name = "show_org" type = "redirectaction">
<Param name = "actionname"> org </param>
<Param name = "namespace">/org </param>

<! -- Exception Handling -->
<Result name = "input">/OrgN/add_input.jsp </result>
<Exception-mapping result = "exception" exception = "com. yy. Exception. commexception"> </exception-mapping>
<Result name = "exception">/common/exception. jsp </result>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.