源服务器找不到目标资源的当前表示形式,或者不愿意透露存在该表示形式。
我什么都试过了,没办法解决。
这是我的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>telusko</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>telusko</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
控制器代码
package tusky;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class IndexController {
@RequestMapping("/")
public String home() {
return "index.jsp";
}
@RequestMapping("/feedback.htm")
public String feedback()
{
return "feedback.jsp";
}
}
请告诉我有什么问题
1条答案
按热度按时间j7dteeu81#
有关更多信息,请共享控制器和路径
您没有使用spring boot,因此web.xml会重定向到spring dispatcherservlet。您的上下文很重要,您可以在web.xml中指定它