ProgJ
2017-09-14 13:16
采纳率: 88.1%
浏览 974
已采纳

Eclipse 测试了一个springMVC小用例

 package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class IndexController implements Controller {
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView("index.jsp");
        mav.addObject("message", "Hello Spring MVC");
        return mav;
    }
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
 111
<h1>${message}111</h1>

新手学习过程中测试了一个用例,发现。。message参数的值显示不出来
各位帮忙看看

3条回答 默认 最新

相关推荐 更多相似问题