博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SpringMVC入门(springMVC的环境配置和入门程序以及简单的流程)
阅读量:3944 次
发布时间:2019-05-24

本文共 3195 字,大约阅读时间需要 10 分钟。

环境配置

首先创建一个maven-web项目

在这里插入图片描述
配置pom.xml

4.0.0
com.tianqicode
springMVC-day01
1.0-SNAPSHOT
war
UTF-8
1.8
1.8
5.0.2.RELEASE
org.springframework
spring-context
${spring.version}
org.springframework
spring-test
${spring.version}
org.springframework
spring-beans
${spring.version}
org.springframework
spring-webmvc
${spring.version}
org.springframework
spring-jdbc
${spring.version}
org.springframework
spring-aspects
${spring.version}
springMVC-day01
maven-clean-plugin
3.1.0
maven-resources-plugin
3.0.2
maven-compiler-plugin
3.8.0
maven-surefire-plugin
2.22.1
maven-war-plugin
3.2.2
maven-install-plugin
2.5.2
maven-deploy-plugin
2.8.2

准备一个controller

package com.tianqicode.controller;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;@Controllerpublic class Hello {
@RequestMapping(path = "/hello") public String helloSpringMVC() {
System.out.println("Hello,SpringMVC!"); return "hello"; }}

配置web.xml

Archetype Created Web Application
dispatcherServlet
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:springmvc.xml
1
dispatcherServlet
/

配置springmvc.xml

准备两个前端页面

<%@ page contentType="text/html;charset=UTF-8" language="java" %>入门程序

Hello World!

spring mvc 入门
<%--  Created by IntelliJ IDEA.  User: 10525  Date: 2020/2/10  Time: 12:35  To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java" %>    success    

Hello SpringMVC

简单的流程图

转载地址:http://ydowi.baihongyu.com/

你可能感兴趣的文章
生活感悟语录
查看>>
用python中htmlParser实现的spider(python spider)
查看>>
在线测速网址
查看>>
mysql中GROUP_CONCAT的应用
查看>>
研发人员的绩效考核
查看>>
Python 3 之多线程研究
查看>>
Python 3中的多线程文件下载类
查看>>
Python库之MySQLdb介绍
查看>>
Python3中利用Urllib进行表单数据提交(Get,Post)
查看>>
Python开发之扩展库的安装指南及Suds(Webservice)的使用简介
查看>>
软件项目管理一点分享
查看>>
iphone程序打包ipa格式
查看>>
Ios开发之Apns功能介绍(应用程序通知)及PHP/Python代码
查看>>
iphone开发的几个Apple官方中文教程地址
查看>>
Algorithms: Kruskal's algorithm and Prim's algorithm for Minimum-spanning-tree
查看>>
Algorithm : Dijkstra's algorithm and Bellmon-Ford Paths algorithm
查看>>
Algorithm: k-nearest neighbors and decison boundary(Cross Validation)
查看>>
Algorithm: Principle Component Analysis for High Dimension Reduction Data
查看>>
Naive Bayesian for Text Classification (MLE, Gaussian Naive Bayesian)
查看>>
Algorithm: Decision Tree, Entropy, Information Gain and Continues features
查看>>