Java and flex Study Notes (11) -- questions about struts2 intercepting flex requests

Source: Internet
Author: User

When I did something yesterday, I found that flex and Java could not communicate well with remoteobject. I thought there was a problem with the endpoint path, but no problem was found after careful troubleshooting. "404" error always prompted:




Later, I checked the error message output on the console and found that struts2 was integrated. Therefore, struts2 blocked the request:


There is no Action mapped for namespace/messagebroker and action name AMF.-[unknown location]


I checked the data online for a long time and found the cause. When we configure the struts2 interceptor in Web. XML, we are used to intercepting all requests, that is:


......

<Filter-mapping>

<Filter-Name> struts2 </filter-Name>

<URL-pattern>/* </url-pattern>

</Filter-mapping>

......


When Flex is integrated with struts2, if this method is still used, it will cause flex to fail to communicate with struts2 using remoteobject. We should adjust it to the following method:


......

<Filter-mapping>

<Filter-Name> struts2 </filter-Name>

<URL-pattern> *. Action </url-pattern>

</Filter-mapping>

......


That is to say, it only intercepts struts2 requests, so that other requests are spared. In fact, this does solve the problem and records it.


Original article, reproduced please indicate the source: http://www.dianfusoft.com/




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.