我试图在PHP中提出一个算法来获取嵌套数组的所有组合:
Array
(
[0] => Array
(
[0] => Option Object
(
[strValue] => rough
)
[1] => Option Object
(
[strValue] => smooth
)
[2] => Option Object
(
[strValue] => coarse
)
)
[1] => Array
(
[0] => Option Object
(
[strValue] => shiney
)
[1] => Option Object
(
[strValue] => mat
)
)
[2] => Array
(
[0] => Option Object
(
[strValue] => Large
)
[1] => Option Object
(
[strValue] => Medium
) …Run Code Online (Sandbox Code Playgroud) 访问http://api:8080/userswhich 404时出现此错误,并且在控制台中出现此错误:
2014 年 9 月 23 日下午 5:57:52 org.springframework.web.servlet.DispatcherServlet noHandlerFound 警告:在名称为“dispatcher”的 DispatcherServlet 中找不到带有 URI [/users] 的 HTTP 请求的映射
当我访问时http://localhost:8080/api/users,我的浏览器中出现 404,但我的控制台中没有错误
应用上下文.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.api"/>
</beans>
Run Code Online (Sandbox Code Playgroud)
调度程序servlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
">
<context:component-scan base-package="com.api"/>
</beans>
Run Code Online (Sandbox Code Playgroud)
网页.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup> …Run Code Online (Sandbox Code Playgroud)