tomcat跑的flex网站
原本是这样的
<servlet-mapping>
<servlet-name>SpringServlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
但是index.swf里设置的路径是
xx.xx.xx.xx/TTT/spring/xxxx
而不是
xx.xx.xx.xx/spring/xxxx
所以我就加了一条
<url-pattern>/TTT/spring/*</url-pattern>
然而并没有什么卵用
比如我访问这个就有反应
xx.xx.xx.xx/spring/messagebroker/streamingamf
访问这个就404
xx.xx.xx.xx/TTT/spring/messagebroker/streamingamf
有人明白我在说什么吗
1
Septembers 2015-07-21 20:17:42 +08:00 via Android
<servlet-mapping>
<servlet-name>SpringServlet</servlet-name> <url-pattern>/spring/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>SpringServlet</servlet-name> <url-pattern>/TTT/spring/*</url-pattern> </servlet-mapping> |
2
loveyu 2015-07-21 20:18:22 +08:00 via Android
使用/*/*试试
|
3
phx13ye 2015-07-21 20:42:25 +08:00
Key rules about servlet mappings
1) The Container looks for matches in the order shown on the opposite page. In other words, it looks first for an exact match. If it can’t find an exact match, it looks for a directory match. If it can’t find a directory match, it looks for an extension match. 2) If a request matches more than one directory <url-pattern>, the Container chooses the longest mapping. In other words, a request for /foo/ bar/myStuff.do will map to the <url-pattern> /foo/bar/* even though it also matches the <url-pattern> /foo/*. The most specific match always wins. http://stackoverflow.com/questions/8995353/many-url-pattern-for-the-same-servlet |