Axis2 + Struts interception address conflict

Source: Internet
Author: User

During the integration of axis2 and struts, Struts intercepts the axis address. By default, it is treated as an action,

An error is reported because the action cannot be found;

1 <! -- Struts configuration --> 2 <filter> 3 <filter-Name> struts2 </filter-Name> 4 <filter-class> Org. apache. struts2.dispatcher. ng. filter. strutsprepareandexecutefilter </filter-class> 5 </filter> 6 <filter-mapping> 7 <filter-Name> struts2 </filter-Name> 8 <URL-pattern>/* </url-pattern> 9 </filter-mapping>
1 <! -- Axis configuration --> 2 <servlet> 3 <servlet-Name> axisservlet </servlet-Name> 4 <servlet-class> Org. apache. axis2.transport. HTTP. axisservlet </servlet-class> 5 <load-on-startup> 1 </load-on-startup> 6 </servlet> 7 <servlet-mapping> 8 <servlet-name> axisservlet </servlet-Name> 9 <URL-pattern>/services/* </url-pattern> 10 </servlet-mapping>

Two solutions:

1. Add the addresses for filtering exclusion to the Struts. xml configuration file.

1 <constant name="struts.action.excludePattern" value="/services.*"/>

The "." symbol in value is required. For example, if the filter address is "/services/*", the value must be set to "/services .*"

Ii. Rewrite the default struts filter class

For detailed steps, refer to this article: http://blog.csdn.net/lishengbo/article/details/5474044

 

Axis2 + Struts interception address conflict

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: info-contact@alibabacloud.com 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.