视图解析器正在解析请求url而不是返回的视图名称,请帮助我,因为我是Spring的新手。
日志显示:
MethodName : springController()
ClassName : ModelAndView: reference to view with name 'StartPage'; model is {message=Hey welcome to Spring 3.0!! }
-------------------------------------------------------------------------------
MethodName :
当我试图用基于注解的控制器访问我的页面时,我总是从tomcat得到“请求的资源不可用”。
控制器:
@Controller
public class HelloWorldController {
@RequestMapping("/hello")
public ModelAndView helloWorld() {
String message = "Hello World, Spring 3.0!";
return new ModelAndView("hello", "mess
我正在用Sping MVC学习/开发JSP网站。我现在面临的问题是,当我尝试访问url“localhost/site/ about /”时,它会显示默认主页,如果我转到"localhost/site“,它会显示主页,如果我转到"localhost/about”,它会显示about page。因此,我不知道如何抛出错误页面,如果有人试图访问任何一个正斜杠的页面。我的意思是,如果我试图访问"localhost/site/about/“或”localhost/site/about/“,我希望我的应用程序抛出404错误页面。
下面是我的web.xml代码
<?xml ve
在我的第一个spring应用程序中,我得到了404错误,它遵循了所有的配置,但没有成功。你能帮我解决这个问题吗。
Following is the change:
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=