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/