b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

spring mvc dispatcherservlet 07:Spring MVC用JavaConfig代替xml搭(3)

电脑杂谈  发布时间:2018-01-21 00:17:51  来源:网络整理
package pers.hanchao.myspringmvc.hello;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * <p>Hello Spring MVC:用JavaConfig代替xml,消除xml配置文件</p>
 * @author hanchao 2018/1/20 19:19
 **/
@Controller
public class HelloController {

    @GetMapping("/helloworld")
    public String helloWorld(Model model){
        model.addAttribute("helloworld","Hi Spring MVC");
        return  "helloworld/helloworld";
    }
}
<%--
  Created by IntelliJ IDEA.
  User: hanchao
  Date: 2018/1/20
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h3>${helloworld}</h3>
</body>
</html>
<html>
<body>
<h2>Hello World!</h2>
<a href="/helloworld">Hello World!</a>
</body>
</html>

这里写图片描述


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-61616-3.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 慕帅霆
      慕帅霆

      我担心的

    • 杨帮辉
      杨帮辉

      不卡

    • 杨苎萝
      杨苎萝

      一直就比大陆人有更高品质的生活和更公平法治的社会环境

    热点图片
    拼命载入中...