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/5+kfzu28vYmQnR4jrSrZmw5ewCa3m6QfdhRodMGEWxHN0svaMAQMMjot1T9UrvjRE8KKJ1lJlSXDKWcmhD5OJzhguUtoMaQxv+NRAJnNjQAICKR0Rb+35ppD+GB0209lZPaYuWfXNrK1r9Nz6sBtECDvGIaD/cvuJqXwwPmmjtrZ6sRUuMVsOyiA+PaRcoyuRJ28KGx3LIULGJdxQAsPCIaHduXdXRE+void1x96OaaOcsWKUlsLJ6shEtOd8kG+5kiakjhskTLVq8PGxmiuEdBQAsPCLabZvL2yLRtkhU6WCVsL16n7LXFVZPVmNeGA8DKeAR0W5+b23rtWjrtej26n2aYluvRfPdLh3LF6JAtEAKeES0G9a//vfOYTooe/Ns9aSOhi1UCaIFUsAjol237g1myHe7ACDzeES0AOAfQLQAwBkgWgDgDBAtAHDG/wcm6vhlHveFNwAAAABJRU5ErkJggg==" alt="" width="316" height="426" />

这个案例用到的是1.com.guigu.shen.Action的包里面的文件(Helloaction.java是控制类,springmvc_005.xml是springmvc的配置文件)。2.springmvc.xml。3.index.xml。4.web.xml。5.jsp/success.jsp

第一步:先写web.xml;

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>SpringMvc_10day_self</display-name>
<!-- Spring提供了一个Filter专门用来解决Post提交中文的乱码问题 -->
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter </filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <servlet>
<!--这个名字可以随便取得,但是这个名字取了之后,以后在 WEB-INF下面创建SpirngMVC的配置文件是,命名必须以这个开头, 所以这里取名叫做DispatcherServlet,那么之后的xml文件取名必须为DispatcherServlet-servlet.xml(一个字都不能差) -->
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class> org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 通知DispatcherServlet去指定目录下找到springmvc.xml配置文件 -->
<!--
注意这里的 <param-name>contextConfigLocation</param-name>一个字母都不能有错
一旦有错就会去WEB-INF下面去找
-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>*.action</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list>
</web-app>

第二步:写spring.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
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.0.xsd http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
>
<import resource="com/guigu/shen/Action5/springmvc_005.xml"/>
</beans>

第三步:写com/guigu/shen/Action5/springmvc_005.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
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.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
>
<!-- 控制器(程序员)(必须配置) -->
<context:component-scan base-package="com.guigu.shen.Action5"/>
<!-- <bean name="/hello.action" class="com.guigu.shen.Action5.HelloAction"></bean> --> <!-- 基于注解的映射器(可选)
这个类和以前的xml方式的类不同,专门是注解用的
-->
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <!-- 基于注解的适配器(可选)
这个类和以前的xml方式的类不同,专门是注解用的
-->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <!-- 视图解析器(可选)
这个类和以前的xml方式的类一样
-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"/> </beans>

第四步:写HelloAction.java控制器。

package com.guigu.shen.Action5;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; /*
* 单例的控制器(由程序员去写)
* 以前我们写控制的做法是implends Controller接口,
* 或者extends Abs...抽象类
* 现在我不想这么写了,用注解来做,写一个@Controller这样就代表这个是一个控制器。这样解析这个类
* 时就知道他是控制器了。
*
*
*/
@Controller
public class HelloAction { public HelloAction() {
System.out.print(this.hashCode());
} /*
*
* @RequestMapping(value="/hello")表示这个方法是用来响应/hello.action请求的
* 按住alt+/就是跳出来注解里面的参数。只要是/hello.action的请求都会交给HelloAction中的
* helloMethod方法来处理。
*
*/
@RequestMapping(value="/hello") public String helloMethod(Model model) throws Exception
{
System.out.println("Hello:helloMethod()");
//往Model中封装数据。
model.addAttribute("message", "这是hello请求");
return "jsp/success.jsp";
} /*
*
* @RequestMapping(value="/bey.action")表示这个方法是用来响应/bey.action请求的
* 按住alt+/就是跳出来注解里面的参数。只要是/bey.action的请求都会交给HelloAction中的
* beyMethod方法来处理。
*
*/
@RequestMapping(value="/bey.action")
//@RequestMapping(value="/hello")
public String beyMethod(Model model) throws Exception
{
System.out.println("Hello:helloMethod()");
//往Model中封装数据。
model.addAttribute("message", "这是bye请求");
return "jsp/success.jsp";
} }

第五步:编写success.jsp页面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head> <body>
Success. <br>
${requestScope.message} </body>
</html>

最后测试一下:输入http://127.0.0.1:8080/SpringMvc_10day_self/bey.action

结果:跳转到success.jsp 并输出“这是bye请求”内容。

输入http://127.0.0.1:8080/SpringMvc_10day_self/hello.action

结果:跳转到success.jsp 并输出“这是hello请求”内容。

对上面的案例流程说明一下:

1.浏览器发出请求,比如hello.action

2服务器根据web.xml的配置来到了DispatcherServlet.并且DispatcherServlet把这个请求给了映射器,映射器会去springmvc_005.xml中去寻找控制器类,到了那里发现了

<context:component-scan base-package="com.guigu.shen.Action5"/>知道了这是注解,所以马上去"com.guigu.shen.Action5"包下面去寻找有没有被

@Controller注释过的类,发现有的,然后找到了HelloAction类。然后去这个类里面去找被注解了@RequestMapping(value="/hello")的方法,然后找到了helloMethod(Model model)方法然后去执行这个方法。执行好之后返回一个Model,然后把这个Model交给视图解析器去解析,解析好之后在交给DispatcherServlet,最后DispatcherServlet根据解析出来的网址跳转到success.jsp 并输出“这是hello请求”内容。

问题:

1.刚开始的时候我在springmvc_005.xml是这么配置的。

<context:component-scan base-package="com.guigu.shen.Action5"/>
<bean name="/hello.action" class="com.guigu.shen.Action5.HelloAction"></bean>
这两个一起配置,然后就会出错,说是重复了。你想啊第一句是通过注解的方式去找了。第二句直接通过xml的方式去找了,相当于去找了两次,当然会冲突啊。 2. 把<context:component-scan base-package="com.guigu.shen.Action5"/>去掉。
保留<bean name="/hello.action" class="com.guigu.shen.Action5.HelloAction"></bean>
我在想为什么也会成功啊?照理说,我在HelloAction类里面的方法也是用注解去配的啊,我都把注解那句去掉了,保留了xml的方式,之前次采用xmL的方式时,里面的
执行方法是有特定写法的?答案:<context:component-scan base-package="com.guigu.shen.Action5"/>这句只是告诉系统前去com.guigu.shen.Action5这个包里面寻找
被@Contolrr注解过的类。至于里面的 @RequestMapping(value="/hello") 这些注解当然可以使用啊。然后只是把寻找里面控制类的任务直接由
<bean name="/hello.action" class="com.guigu.shen.Action5.HelloAction"></bean>去完成了罢了。并不影响 @RequestMapping(value="/hello")注解的寻找。
 

10SpringMvc_springmvc快速入门小案例(注解版本)的更多相关文章

  1. 02SpringMvc_springmvc快速入门小案例(XML版本)

    这篇文章中,我们要写一个入门案例,去整体了解整个SpringMVC. 先给出整个项目的结构图:

  2. struts2框架快速入门小案例

    struts2快速入门: index.jsp------>HelloAction--------->hello.jsp struts2流程 1.导入jar包 struts2的目录结构: a ...

  3. Hibernate的介绍及入门小案例

    1.Hibernate的诞生 在以前使用传统的JDBC开发应用系统时,如果是小型应用系统,并不觉得有什么麻烦,但是对于大型应用系统的开发,使用JDBC就会显得力不从心,例如对几十,几百张包含几十个字段 ...

  4. 【第二篇】ASP.NET MVC快速入门之数据注解(MVC5+EF6)

    目录 [第一篇]ASP.NET MVC快速入门之数据库操作(MVC5+EF6) [第二篇]ASP.NET MVC快速入门之数据注解(MVC5+EF6) [第三篇]ASP.NET MVC快速入门之安全策 ...

  5. spring boot入门小案例

    spring boot 入门小案例搭建 (1) 在Eclipse中新建一个maven project项目,目录结构如下所示: cn.com.rxyb中存放spring boot的启动类,applica ...

  6. SpringBoot介绍,快速入门小例子,目录结构,不同的启动方式,SpringBoot常用注解

    SpringBoot介绍 引言 为了使用ssm框架去开发,准备ssm框架的模板配置 为了Spring整合第三方框架,单独的去编写xml文件 导致ssm项目后期xml文件特别多,维护xml文件的成本也是 ...

  7. SpringBoot_MyBatisPlus快速入门小例子

    快速入门 创建一个表 我这里随便创建了一个air空气表 idea连接Mysql数据库 点击右侧database再点击添加数据库 找到Mysql 添加用户名,密码,数据库最后点击测试 测试成功后在右侧就 ...

  8. React.js入门小案例

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title&g ...

  9. Spring中AOP的初窥和入门小案例

    AOP:面向切面编程 AOP的主要作用:是为了程序员更好的关注"业务",专心"做事" 加上双引号的意思:所谓业务,是指他的核心,各行业中需要处理的核心事务,核心 ...

随机推荐

  1. SarePoint Powershell Add user to Group

    $FromGroupnames = "001总经理","010101管理本部" $ToGroupname = "test" $SPWeb = ...

  2. English Training Material - 05

    Could I leave a message? Language Checklist Telephoning (1) Introducing yourself Good morning, Arist ...

  3. Android源码分析之Message

    准备开始写点东西,算是对自己阅读源码的一个记录/笔记,也希望能对同样感兴趣的人有所帮助,希望能坚持下去,加油. 在Android的开发中,我们经常用到Handler.postXXX方法,或者View. ...

  4. ios appIcon配置

    iOS 我所知道的Assets.xcassets 字数923 阅读723 评论1 喜欢3 Assets.xcassets是用来存放图像资源文件的.将一个图片放在Assets里面是这个样子的 目录结构 ...

  5. iOS-申请测试证书详解(多图原创)

    申请测试证书详解 前言 App开发和发布过程中证书基础知识:1. Certification(证书)证书是对电脑开发资格的认证,每个开发者帐号有一套,分为两种:1) Developer Certifi ...

  6. android学习笔记 对话框合集

    package com.zhangbz.dialog; import android.app.Activity; import android.app.AlertDialog; import andr ...

  7. C语言-04-函数

    函数 函数是一组一起执行任务的语句,函数是一个可执行C程序必不可少的条件(至少一个main()函数),函数的定义形式 returnType functionName() { bodyOf of the ...

  8. iOS开发 -- 为本地文件添加自定义属性的工具类

    前言:实际开发,我们可能会有这样的需求,就是为文件添加自定义的属性,或者是可以将文件的相关信息添加进该文件的属性中,这样可以以备下次读取利用. 那么本文就是要介绍"拓展文件属性的工具类&qu ...

  9. java 的方法注释写在哪里?

    如果有接口,写在接口方法上即可.鼠标滑过方法名时时会显示 如果没有接口,写在每个方法上方. eclipse 分三步 ① 找到方法,并将光标移动至方法名的上方 ②/** ③回车 那,效果是酱紫

  10. mybatis3.3 + struts2.3.24 + mysql5.1.22开发环境搭建及相关说明

    一.新建Web工程,并在lib目录下添加jar包 主要jar包:struts2相关包,mybatis3.3相关包,mysql-connector-java-5.1.22-bin.jar, gson-2 ...