Java 在SpringURL中导航
我有一个关于导航的问题 目前这是我的网址Java 在SpringURL中导航,java,spring,url,Java,Spring,Url,我有一个关于导航的问题 目前这是我的网址 http://localhost:8080/spring/Account/ump 我想导航到 **http://localhost:8080/spring/Scheduler/test** this is the URL i am trying to hit but i cannot find the correct ahref code to achieve 我的代码 <li><a href="/Scheduler/test"&g
http://localhost:8080/spring/Account/ump
我想导航到
**http://localhost:8080/spring/Scheduler/test**
this is the URL i am trying to hit but i cannot find the correct ahref code to achieve
我的代码
<li><a href="/Scheduler/test">test page</a></li>
对于重定向结果,它将是
redirect:/Scheduler/test
如果有必要,我会使用InternalResourceViewResolver 如果您能够在页面上使用JSTL,请使用在核心JSTL中定义的c:url标记。url标记始终将实际上下文路径附加到url的开头 例如:
<li>
<a href="<c:url value='/Scheduler/test'/>">test page</a>
</li>
@ali786我无法获取我想要获取的URL。您正在获取此URL,对吗correct@ali786不,我正试图得到这个,但我没有用我所有的代码得到它。give/spring/Schedular/test/Scheduler/test
更改为Scheduler/test
我能够使用JSTL。但是我可以知道url是什么吗?您只需要导航url而不是实际的上下文路径,因为c:url将上下文路径附加到起始位置。@galvoics Thx以获取答案
redirect:/Scheduler/test
<li>
<a href="<c:url value='/Scheduler/test'/>">test page</a>
</li>