qq_28254507
ProgJ
2017-09-14 13:16

Eclipse 测试了一个springMVC小用例

  • spring
  • eclipse
 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条回答

为你推荐