Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring启动-忽略属性服务器.contextPath_Java_Spring_Web - Fatal编程技术网

Java Spring启动-忽略属性服务器.contextPath

Java Spring启动-忽略属性服务器.contextPath,java,spring,web,Java,Spring,Web,在我的spring application.properties中,我得到了属性 server.contextPath=/my/context/path 但我需要设置将处理此路径的控制器: http:/localhost:8888/ 有没有办法只在一个控制器中忽略server.contextPath属性 谢谢不用了 使用一个DispatcherServlet时,可以删除server.contextPath属性并注释所有控制器,但使用@RequestMapping/my/context/pat

在我的spring application.properties中,我得到了属性

server.contextPath=/my/context/path
但我需要设置将处理此路径的控制器:

http:/localhost:8888/
有没有办法只在一个控制器中忽略server.contextPath属性

谢谢

不用了

使用一个DispatcherServlet时,可以删除server.contextPath属性并注释所有控制器,但使用@RequestMapping/my/context/path注释的控制器除外


另一种选择是使用两个DispatcherServlet。一个映射到/*包含一个控制器,另一个映射到/my/context/path/*包含所有其他控制器。

您能再描述一点吗。?