spring-mvc hello world (1)
我学习一个程序,都是从DEMO开始的。
先不了解SPRING-MVC的原理,但一些小的概念还是需要了解的。由于之前有过SSH的工程经验,故基本的东东,不在叙述。
1、准备环境
JAR包:aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP4AAAG9CAIAAAC6T1xwAAAgAElEQVR4nO2dW5Pcxn32+yPkK+Qql7kRt4Zzmau3/BFSFg/LzXyANzep5MoOxbOqUDm+F6+dOFFsSqLIpVicrDak6TiyS6Yk0paWS4uIKBflUDLJlfc8O7MzRC4wA/Th343GDIBpoJ9f9cVMo9EnPAAamH6m2cEv/+Lgl3/x9S/PvfN//zgCwBvY9zt/FId51wSASmHzrgAA8wHSB54C6QNPgfSBp0D6wFMgfeApVtL/iZ4f//jHt2/fLruWABSOrfSHh4fD4eFoNByNhi9fjl6+HA2Hhy9fju7evbu6unrr9q2yKwpAsVhJ/86dO4eHA1X9L1+Ofvazn+3v76+srNy5c6fkqkp0O6zT5T+EQZu1g7DaWuSlFpX0Ayvp3759ezDok+pfXV1dWVlZWVlZXV0tu64i85Z+t8PYuAb0NsaYWh9I3xmspH/r1q1B/+A/7/367voXH67/5sP139x98MWH67+5u/7FT+9/9vR//uc3X3wxf+lXRxi0GWt3Om2yYE7d3Y727ADzxkr6q6ur/YPeTz5cGw6Hw+FwMBj8/uf/NBgMhsPhTz5ciy//KysrZddVZI7SjwkDUvpCtCYNcAAr6a+srBz09v/9vz4+ODjo9XrP37vw7P1//v39dw8ODv79vz7OkH4YtMd3f14EyZCAj46Fkm5K0xOZkAOeyUY6fTsIOspAJC1uEqnGaBtGyFo8E7sdMZOMSnI9gGFRyVhJ/+bNm739/XdW39/e3t7c3PzdzTPP/v7/vHjx4ptvvnln9f143H/z5k1q1zDoTA5hevfvdvgjm8bHWuC0msTTmeikry2UKycuX6zJOFkSYb5m01ulWL30yUqKPQDKJEP63zr9Dh+ePXv2/6+894P/9/o/v/FG9z/v/u0Pb/7g2nuj4eFoNLxx44YuE/nqppWD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VZwY/ko/ajW3lxqwKN9lRfCblt7u20uGu3NTVLFz8mUFZ1ILD/jwW7rpfTr7c0FNjRW2xk02ZsLbNCOAJtOQ725wIbG2W1zAW8u8BRYVYCnQPrAUyB94CmQPvAUeHOBp2ikzxgCQp1CkdLn8Mab6+sPm5Y4++tXedL3xptrL324eF2iPOnX1pubF0vph3DxukV50q+tNzcv+Q88XLwuUJ706+nN5WXJXeEIS5dkllXrpgUuXu0R1De7eMqTfk29uXwe7XZqclFUINpoSEMVkbX53MiWPly8hVGG9OvtzZ1k0u20gzAeZHM5iEiuDbEScPESGzX3c12Ly6QM6dffmyuKvhtIF3+1nlTdDMDFK5i8miP9qN7eXOHFRvyZGP1HUbfD3bKJuimZquNx+cWf2hy4eEujJOnX2psr6FdSne5BjVxGl8hV3RUu3gZJH95ckDI/bWdQhvThzQUJ1FjNDUqRPry5IHLexVvee314c4HTlCd9AJwG0geeAukDT4H0gaeUJ314c4HTlCp9rJsL3AXe3EJKdfXddVMo48jCm1tIqRVKHwbfgoA3d2aqlH4Ig29hwJs7M3Ma8MDgOyPw5koU583tdth46d1xZJevj3AL576o+dPA4KuVgb7ZAvDmaguf1ZvLHYlYz9KNPc2Mj8o6diF3LulTmKUPg28UwZubFsdK8OaS7tbk8+QDuYfQFcTVDAZf7hSZarAEby5VbiHe3Ezpjz+lQ9987hkYfAX/lxPSj+DNleug+RwG7Xan0+Y3pfoLyLNMHY/LL/7UPoHBlwLeXAJezJJgdM9YRN0spC+eNmL++oszUT4Mvm5IH95cUDAlHP+ipY+AUKNQmPQnwJsLCsMxgy/WzQWeAksK8JT/BXNSKhJBI9p2AAAAAElFTkSuQmCC" alt="" /> 红色的这几个。PS:之前忘记写了,我整合的mybatis和mysql,故JAR包比较多
2、JRE环境。
这个需要注意,好像这个版本的SPRING不支持1.8 。我的是1.7的环境。由于之前升级到1.8但是出问题后,又降到1.7了。
3、编写spring-mvc.xml配置文件
如下代码,里面有具体的说明,不再一一叙述
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"> <!-- 扫描controller(controller层注入) -->
<!-- <context:component-scan base-package="com.demo.controller"/> -->
<!-- 启动注解驱动的Spring MVC功能,注册请求url和注解POJO类方法的映射 -->
<mvc:annotation-driven />
<!-- 启动包扫描功能,以便注册带有@Controller、@Service、@repository、@Component等注解的类成为spring的bean -->
<context:component-scan base-package="com.demo.*" /> <!-- 配置返回值json -->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="messageConverters">
<list>
<ref bean="jacksonMessageConverter"/>
</list>
</property>
</bean>
<!-- 避免IE在ajax请求时,返回json出现下载 -->
<bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/html;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
</bean> <!-- 对模型视图添加前后缀 -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsps/" p:suffix=".jsp"/> <!-- 输入参数类型支撑 -->
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
<bean class="org.springframework.http.converter.ResourceHttpMessageConverter"/>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>
</mvc:message-converters>
</mvc:annotation-driven> </beans>
4、一切从WEB.XML文件开始
在WEB.XML文件中加入
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置spring核心servlet -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:config/application/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet> <!-- url-pattern配置为/,不带文件后缀,会造成其它静态文件(js,css等)不能访问。如配为*.do,则不影响静态文件的访问 -->
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOgAAACiCAIAAADECBYlAAAO9ElEQVR4nO2dz08bZx6H59/IYQ+VqqyqHCIQtgKHaMWhkbl0S5SI0GAMzZpE6ilcuuqhgZrE2SLFaqIoaqJoDxviJMBmo2Bp0aKulIWEJIV0E3mjQdAKR4VgmxiwYQxtZw/z652Z9x2PPeOZee3vo/cw8/p93xngYXjHfj8MwwMAhTBunwAAVEIVxQ0fbqze4ECdY4O4j772y4Xn+cEj+/TF+lEAAMWquGOfvY/upub/OXhk3+725OrMleGuD4UNEBewnRLifvfdd9FolPTqoyE/t3qNW72Wex1bfRH96d+fv/txZvDIvtWZK/+9dy58uFHYAHEB2zESd2pq6sCBA/v37yc1+NdQI5d7gpY/f/SHwSP7hrs+DB9uFMpw14eDR/Zh57sLsRZGJJyQKsKJRJhhmJbYAs/zfCIstRArAIDneQNxBWs7OjqMxP2ykVu9j5Zftn+Upwrhw41GUwXBUl0Vo1QmwuArQAAvrmztiRMnDMR9+GUj99Nf5TJ29qBB0fUWrqaomWqXE2HQFiCBERe11ljcsbMHuNcxoYydPcj9dA1bVl9EceIKCFdZwVAQFzALRtxoNLof4fz586TOtz57n3sd5V5Hx84eFDb0hWjtQiyWkLZEXzWzh0RYmTckYuAwgGDp7bCb3b/jXnw+dvYg9+Icthhea5E7L1FP3bRXuX3TzIaBeseSuJfa942dPci9+BxbjK0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yLCR3jmw2u7S46ES6paZZWlz0jrV8PYgL1CQgLkAlIC5AJSAuQCX/B+yiCh9x9xMkAAAAAElFTkSuQmCC" alt="" />
注意路径
5、后台代码部分
需要一个controller,我这边都是采用注释
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAApCAIAAADiXM91AAAHz0lEQVR4nO1a7U8bRxqf/6Ifo0vVKAo6KUnZrUMpyn+QT5FASo0xErr2VAXuro1y4RSFGDCmd7WK1FRKxZEqoaYgiPhAWuUQygeUGBEsCKdIi3BqmwB+GWe9L95dbyTfh30br3cNLutwhvnpkTXzzO955lnPzztje0ERA6MagFok7Wl+rxZpncBcF+iaK2lgVAdnFLPQd+7J3/+o28jlE2h3oe+cI7M4AayYg8IZxTy51rCxMPo6fO91+N7K5PBodyvafXKtwZFZyrARbKp22bFiDoq9FbOwsOD3+/fgfHnmdfielHsMV8df/nJntLsV7S58ecahak3AijkE7KGY+fn5hoaGU6dOVaY97jnzOnwPro7D1fGXv36vKEbvPu6poJi5LqCiKbhh8gBjUee6QFMw2IUwEVpTcENVz1yXkcguT7liymsoz4ahopJiFLm0trbuqZhHX5xemRx++cudl79+/3Ss7/qli2j30RenbeLmuswrUuqZ6wLGAmvNjWCTSkHvMRvBJpMy7PKUN3SintCUDcOArWJ0ubS1tVVWTE/zeyOXT4x2typ2/dJFxXTPyOUT1t+e0MWy9uhLaFpXa8UYK1wpT6li0DuRcZv5HfvdcYG1YlC57KmYYrE43fkBetS9fuki2p3u/MA6bF+KUfoHV4yep0wxFvsOVowtrBXj9/tPIRgYGKicZcLzfoWT74TnfZs4Y7coFueC2umkZDcxDiXVKKZSnvJdCd3MjJ0PK8YSzny7fnDlZIWT74MrJ20jlQOD+XBqc/I1K0aLNk6+aOp9n3yNGuz0h2HAGcX82HYSPeqOdrei3R/b7BWDUW9wRjGLt8+Ptf1Bt5HLJ9Du4u3zjsyC8f+A4/a/EsZBURPFYBxhYMVgVAesGIzqcAiKyeVy8XicwnAa8Xg8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sixVp+nhywME0K5Od2qXvNxPIENmGs/n61Ix6XS6wjmG47iMhn9du7CdFZ/G4Odji5+PLSqK2YbSdlbcgeI/r13I2CDkBoRvydzMLPkIpR1yA+AO6U6gUVB/JuRWm0qKJR8ByqNLotCBkM+3pCRXPUYz5AZGTUiBVqXqs+rhCGvJR5RcB+F2ExbXrdM4jqtLxVT+rsRxXFqD/6uPE2nxaQy2/OUnRS5baTGRFhMZMZGWhr76OG2FsI9QPvjuUDqdDrkB4QvrI1o75NZuD4TPV0rRBtwhjaiOhpV3XtEFOqPhMcJVhuogfOGwjzDCjOlBibOs1LCPAHrDPAfhdiM51fLK3gaDVpeK2fP3GJZlkxr6/9ocS4qxlPhobevR2lYsJcZS4m8pMZYUYynB97fm5PHBs9uN4NOfDpaDZdn6U0xlUBTFMMyuhls9za92heiu+GpXeKW+Cq92heiuEN0V+nqad48NnvU1gsa+ZwdLwjDM0VTM9vaOYje7P7lxtaW3u6W3u+UG8tp7taX3asvN7k905lG2+1cAAABcuX/gVEdQMdFolKbpVCq1jeE0UqkUTdPRaLSmK3gYT1TF4zRN2/00h/G7QdN0Ih4/ak9UFYtFCGF0c7P2DzEeO0Q3N2stlyJ+MhyjWmDFYFQHrBiM6oAVg1Ed/gfspGAeyVjfbwAAAABJRU5ErkJggg==" alt="" />
源码为:
@Controller
public class IndexAction { /// @Autowired
// private UserService userService; @RequestMapping("/index")
public String index()
{
// LogTool.Logtool(IndexAction.class).error("Hello world.");//这里可以注释掉
// User user=userService.checkLogin("1", "1");//
// System.out.println(user);//
return "/index11";
}
}
一个界面:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN0AAABECAIAAACKz6fGAAAGLUlEQVR4nO2d30scRxzA73/wqQ+FIsE++CD44MM+SdOXvuYh8ehDQMoWWvHHlVJLSNMQzlwTxG1JWquJRjRGEq81rC60UUy4SPNQ4qUN1bJNVQjNRWyRoGTPU64Pezc7szs77u15u3Nz3w/fh5u5mb2F+zCzv747kTwA8Eck7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UcMJIQJ6md3bR7GXO9jLHYw9eZLfWVv57erSs765p0PRq7dP9U5ROgfgpf11nu6Vpe6PWIjm5UP1k9fZHIrc/kFu/6BLVaf//GP8/vUJ7b2R6+9+fHY02knzsiRK9tJ80assO5+ss1cCwnn54O5nu0YOhTledqnqOw82ojfnzn54/NPO7hOdP/ac6S/3l3zO49QboXB31I5oXi788Pmr3Zwt5hfunhp/eHzgaXvP9Mn28ZPtF4a/+4rSmXjQXVIU2bEwCvmCbPId7nidbRkg24u3vXrpK1FJDETz8qfpM9u7OTzq6lvr6lv1lcexy0Pvd3zzUUz5/tsL9M62BAxLALRqkPX3azJtuRW72rpjWPXlpfdEJVEQzcu521/8+2oPD9NL8/Pj5SVWZ4dUxVpJ0R0TNyqSYyg2jFJzhvyNl94TlQRBNC9nbp3f3M7iYXppfp65dZ7V2beXrssDHZWXVtlbolLVI5qXdybi//yXxcP00vx8ZyLO6sz2kpgs8VVUbPM7sbqk41KPBy9RHx+JSqIgmpeTYxefb2Wfb2WRi3X1rR90Fyonxy6yOh/iJXl6o9iOKonzD+zoEzljW2oIX/ecrHR6WUqikhiI5uX46KWNTWNj0zCHSTMmpu+ZleOjl8LewVKo4UQl0bwcvda/9tJYe2lMTN9DUpo1f2eM0WtlX7YMkFpOVBLNy+Ghgb9evHaL4aGBsHfQGzWfqCSal4ODX7Mj7B0EPCGal4AYgJcAj4CXAI+AlwCPgJcAj4CXAI8I6aUmWzf5qE85ALzDtZc+1+8BL6ufoL1cWlra2dnx0rKM9XuKXlqAl1VG0F5OTk5OTU1tbW2xm5W3fg94WfX8D+97AmQVYKjSAAAAAElFTkSuQmCC" alt="" />
6、运行测试
浏览器中输入:http://localhost:8080/Spring-mvc/index
成功!
spring-mvc hello world (1)的更多相关文章
- 如何用Java类配置Spring MVC(不通过web.xml和XML方式)
DispatcherServlet是Spring MVC的核心,按照传统方式, 需要把它配置到web.xml中. 我个人比较不喜欢XML配置方式, XML看起来太累, 冗长繁琐. 还好借助于Servl ...
- Spring MVC重定向和转发以及异常处理
SpringMVC核心技术---转发和重定向 当处理器对请求处理完毕后,向其他资源进行跳转时,有两种跳转方式:请求转发与重定向.而根据要跳转的资源类型,又可分为两类:跳转到页面与跳转到其他处理器.对于 ...
- Spring MVC入门
1.什么是SpringMvc Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面.Spring 框架提供了构建 Web 应用程序的全功能 M ...
- Spring7:基于注解的Spring MVC(下篇)
Model 上一篇文章<Spring6:基于注解的Spring MVC(上篇)>,讲了Spring MVC环境搭建.@RequestMapping以及参数绑定,这是Spring MVC中最 ...
- Spring6:基于注解的Spring MVC(上篇)
什么是Spring MVC Spring MVC框架是一个MVC框架,通过实现Model-View-Controller模式来很好地将数据.业务与展现进行分离.从这样一个角度来说,Spring MVC ...
- 高性能的关键:Spring MVC的异步模式
我承认有些标题党了,不过话说这样其实也没错,关于“异步”处理的文章已经不少,代码例子也能找到很多,但我还是打算发表这篇我写了好长一段时间,却一直没发表的文章,以一个更简单的视角,把异步模式讲清楚. 什 ...
- Java Spring mvc 操作 Redis 及 Redis 集群
本文原创,转载请注明:http://www.cnblogs.com/fengzheng/p/5941953.html 关于 Redis 集群搭建可以参考我的另一篇文章 Redis集群搭建与简单使用 R ...
- 深入分析Spring 与 Spring MVC容器
1 Spring MVC WEB配置 Spring Framework本身没有Web功能,Spring MVC使用WebApplicationContext类扩展ApplicationContext, ...
- spring mvc DispatcherServlet详解之前传---FrameworkServlet
做项目时碰到Controller不能使用aop进行拦截,从网上搜索得知:使用spring mvc 启动了两个context:applicationContext 和WebapplicationCont ...
- 我是如何进行Spring MVC文档翻译项目的环境搭建、项目管理及自动化构建工作的
感兴趣的同学可以关注这个翻译项目 . 我的博客原文 和 我的Github 前段时间翻译的Spring MVC官方文档完成了第一稿,相关的文章和仓库可以点击以下链接.这篇文章,主要是总结一下这个翻译项目 ...
随机推荐
- 优化tomcat配置(从内存、并发、缓存)优化
一.Tomcat内存优化 ** Tomcat内存优化主要是对 tomcat 启动参数优化,我们可以在 tomcat 的启动脚本 catalina.sh 中设置 java_OPTS 参数. JAVA_O ...
- debian repository的成长过程
1 基本概念 1.1 健康的安装 在端系统中的一次健康的安装指的是,在安装的包的集合中,所有的依赖都满足,并且没有冲突存在. 这的健康的安装是相对于端系统而言的,并不是相对于整个repo而言的.对整个 ...
- ABAP JSON
1 DATA: lv_em TYPE string, lv_em1 TYPE string. DATA: lt_but021 TYPE TABLE OF but021, lt_but0211 TYPE ...
- forword 与 redirect
直接转发方式(Forward) 客户端和浏览器只发出一次请求,Servlet.HTML.JSP或其它信息资源,由第二个信息资源响应该请求,在请求对象request中,保存的对象对于每个信息资源是共享的 ...
- 使用buildroot搭建linux文件系统【转】
本文转载自:http://blog.csdn.net/metalseed/article/details/45423061 (文件系统搭建,强烈建议直接用buildroot,官网上有使用教程非常详细b ...
- ubuntu中pytesseract 安装与使用示例
1. 安装 tesseract-ocr 包 安装方法: sudo apt-get install tesseract-ocr 2. 安装 PIL PIL(python imaging library) ...
- HDU1175:连连看(搜索)
传送门 题意 给定一个n*m的矩阵,询问q次,两个方块是否能被消掉,弯折次数不超过两次 分析 这题写了有一个下午,思路很简单,但是有很多trick,(唉),我还是太弱 trick 初始判断:1.两点不 ...
- bzoj 1787: [Ahoi2008]Meet 紧急集合【树链剖分lca】
对于三个点求最小路径长度和,答案肯定在某两个点的lca上,因为如果把集合点定在公共lca上,一定有两个点汇合后再一起上到lca,这样显然不如让剩下的那个点下来 这个lca可能是深度最深的--但是我懒得 ...
- spoj 839 OPTM - Optimal Marks&&bzoj 2400【最小割】
因为是异或运算,所以考虑对每一位操作.对于所有已知mark的点,mark的当前位为1则连接(s,i,inf),否则连(i,t,inf),然后其他的边按照原图连(u,v,1),(v,u,1),跑最大流求 ...
- 洛谷P3211 [HNOI2011]XOR和路径(期望dp+高斯消元)
传送门 高斯消元还是一如既往的难打……板子都背不来……Kelin大佬太强啦 不知道大佬们是怎么发现可以按位考虑贡献,求出每一位是$1$的概率 然后设$f[u]$表示$u->n$的路径上这一位为$ ...