我们要实现这么一个功能:

编写两个表单,提交到同一个Action中的不同的处理方法中。比如注册和登录,都提交到UserAction这个控制类中。但是这两个提交由userAction这个控制类不同的方法去处理。

案例结构如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASoAAAFWCAIAAABRuEfCAAAgAElEQVR4nO2dfXQUVZ73yz/mv/2Dc/Acd//YMw6PizicRwYE99la18Fx9gk+85zHOc7yEmdAxtmtVXHkZXRMxEgCBrMRxlISCSIQFhJ7YsJEIy0RM8AgkEQGAghk6MEkJJCk0x2avFbohPv8UdVV91bdekn6pd5+n3P/6K6+das61Id7q7rutxgEAIBNMHbvQOpZ+8g9du9CSgnxLMPyoRS2GORS3OBkSP3XcTFe0O/IxrnHXvufctm2+Lv42yMb59q9g8nhdP1CPMswXHAy1ae69SDHSFjfnqPxgn7HXp0dOrL7etPe6017z3z89u41y/C3x16dbfcOOo2U6hfiWZZlTXwI8WY1zLG1z04TTtfvyJEjRUVFJnVe+f71pr1jtw5Hz1VePrR995pl+Nsjr3w/M7vqHlJ5IId4luVDQc7YruT1E7eTTAtOxNH6NTQ0zJ49e+bMmcbVDq/9/vWmvdFzldFzlZfry0T95LeH1+rrFw4E8p4/HTbdEWXQkzgElCXYQCjIMSwf5Fl5aaIW7cCRW2B5PqEDfpTKr4lD1/JaGCFpj+RdDXLi6upxHPVrKjVp3yJhhdpovCle+VuxfIj+dTR/RtVGQzyLNeQZEZ2rn+jesmXLTPX7/Nezznz89uVD2y/Xl50q35j75EL87ee/nmW4dufpkqzSvKzSvOKr9ApBTv3vTS4JcthhnfhAPK7ExRQllHUkOyzpN5m1ZHS2ju2bvMfyd5LXodYkW5KW4atr/2LYTpBfR/fPqNootsxLF28cqp/sXnZ2trF+ax+5Z9vi7+5es0wsuU8uzH1y4VQ2GQ4E8rLqL2qWa0dq6iX4wYofgtTXtAVBa73fpNYiNqbqMFSmKcc3jqZTowz/6F+SMral6Wfpz0jvXT1zGuhE/XD3TPVDCB341T/g11pE/aZvusj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XFoJbADru1i+prBdVpoNihDy/XS/0RZvakliq7SQhuAXQx936Hax6IzpwGy+TyHrRuJNYSouHwFMnKKkt8geaESoEtwD6uFu/2o8KwrExvEwy62VK+tFPAk31U95DcAsg4m79Pt5feKN/DC+TyHox1s9S6Iuc2iI1oQxdIbgFsIC79avc+1ZXZKwrMjZ9xkJZP6tZLyb66Ye+aC6hYGeGCYkguAWwgLv127enuCMsdIQFsdMTi7OyXiC4BdDH3frt+XBrW6/Q1ivsrz4su+eorBcIbgEMcLd+Oz94Rwx3URXxU5uzXiC4BTDD3fqJyS7aYvd+AYAl3K0fALga0A8AbAP0AwDbAP0AwDZAPwCwDdAPAGwjXfpVFm+US5o2IeHYNAeYoQuY8f8BNZArcvs568YAAAAASUVORK5CYII=" alt="" />

这个案例用到的文件有:1.UserActio.java(控制类)2.Spring.xml(总的配置文件)3.springmvc_006.xml(这个项目独有的配置文件)4.adduser.jsp(有两个表单的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/Action6/springmvc_006.xml"/>
</beans>

第三步:编写com/guigu/shen/Action6/springmvc_006.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"
>
<!-- 控制器(程序员)(必须配置)
这么一配置的话系统就会去com.guigu.shen.Action6这个包下面去寻找有注解@Controller的类。 -->
<context:component-scan base-package="com.guigu.shen.Action6"/>
<!-- <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"> </bean> </beans>

第四步:编写控制类UserAction.java。

package com.guigu.shen.Action6;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
/**
*
*
请求路径可以拆分为:根模块的名字+分模块的名字
就是相当于当访问http://127.0.0.1:8080:项目名/user/register时就会进入到
registerMethod方法。 */
@Controller
@RequestMapping(value="/user")//根模块的请求名字
public class UserAction {
/*
* 员工注册
*
*/
@RequestMapping(value="/register")//分模块的请求名字
public String registerMethod(Model model)
{ model.addAttribute("message", "员工注册成功");
return "/jsp/success.jsp";
}
  /*
* 员工登录
*
*/
@RequestMapping(value="/login")//分模块的请求名字
public String loginMethod(Model model)
{
model.addAttribute("message", "员工登录成功");
return "/jsp/success.jsp"; } }

第六步:测试 输入hhttp://127.0.0.1:8080/SpringMvc_10day_self/ad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9fFC7GYLat2XW66S+npq66VUq3mZiChnNuelVyOjr9TohFW99czP1HeJQe/mgdjOmrJ0tUftw3kq9XqnU65WK5w1vx/hNgdrdgNrN4NV+cnLyWcGrO5XKnVfR/9euk9j/o9kIIdfXgvnXrhNyfU3lDj5/Pjk5Qe0lg9rNENT+ScnL2zNk5vbLT58+fXp0jZBrjxLXP7pGSDT55e2Z0cwvb8+Q4IZCqL18ULsZvNr7/X6Hz781I/9gbeaW79+aIVcfxm4xc8tPfJ/YlLR+v4/aSwa1mzFZ7XlC7eWD2s0Q1P5XMaD28kHtZvBqPz4+/rMYjo+PUXvJoHYzmLV7ntftdnu93h+m9Xq9breL49KVDGo3g1l7u91eXl7e29s7Nm1vb295ebmNY86WC2o3g1n7xcXF0tKS53k6DxWvxPO8paUlemnzfXpAC9RuBq/2YkLt5YDazUDtkD/UbgZd+5YNTD5ZkBHUbgYSgvyhdjNQO+QPtZuxtbX19OnTOYDcmf7Z16W4tSN1MMX0z74uxa0dALKF2gFcgdoBXIHaAVyB2gFcgdoBXIHaAVyB2gFcgdoBXIHaAVyB2gFcgdoBXIHaAVyB2gFc8X8ikf+ghKMPlgAAAABJRU5ErkJggg==" alt="" />

按下注册按钮。会进入到http://127.0.0.1:8080/SpringMvc_10day_self/user/register.action。从而执行控制类UserAction里面的public String registerMethod(Model model)方法。

按下登录按钮。会进入到http://127.0.0.1:8080/SpringMvc_10day_self/user/login.action。从而执行控制类UserAction里面的

public String loginMethod(Model model)

方法。

总结:通过模块根路径 + 功能子路径 = 访问模块下子功能的路径

11SpringMvc_一个Action中,写多个类似的业务控制方法的更多相关文章

  1. 一个Action中,可以写多个类似的业务控制方法

    1)通过模块根路径 + 功能子路径 = 访问模块下子功能的路径 @Controller @RequestMapping(value="/user") public class Us ...

  2. C# List中写出LINQ类似SQL的语句

    很多时候,从一个关系表中挑出一个我们需要的元素列表采用SQL语句是再容易不过的了,其实C#的List中也可以采用类似的方法,虽然List中集成了Select(), Where()等语句,不过如果你的判 ...

  3. 10、一个action中处理多个方法的调用第二种方法method的方式

    在实际的项目中,经常采用现在的第二种方式在struct.xml中采用清单文件的方式 我们首先来看action package com.bjpowernode.struts2; import com.o ...

  4. 10、一个action中处理多个方法的调用第一种方法动态调用

    我们新建一个用户的action package com.weiyuan.test; import com.opensymphony.xwork2.ActionSupport; /** * * 这里不用 ...

  5. 解决:一个项目中写多个包含main函数的源文件并分别调试运行

    自己在学c++的时候,一个项目中的多个cpp文件默认不允许多个main函数的出现,但是通过选项操作能够指定单个cpp文件进行运行,如下: 1.此时我就想运行第二个cpp文件,我们只需要把其他的两个右键 ...

  6. 从一个集合中过滤另一个集合中存在的项(类似in)

    直接贴代码出来: List<PriceMark> list = PriceMarkDAL.m_PriceMarkDAL.GetList("Erp_ProName='TLC7528 ...

  7. Spring MVC 中采用注解方式 Action中跳转到另一个Action的写法

    Spring MVC 中采用注解方式 Action中跳转到另一个Action的写法 在Action中方法的返回值都是字符串行,一般情况是返回某个JSP,如: return "xx" ...

  8. Struts2 Action中的方法命名不要以get开头

    偶然发现,在调用一个action中的某个方法时,会自动调用另一个无关的方法,找了好久,最后发现是方法命名的问题,方法命名以get开头,action会自动调用!所以,以后再写action中的方法时尽量不 ...

  9. 10.Action中的method属性

    转自:https://wenku.baidu.com/view/84fa86ae360cba1aa911da02.html 在struts1.x中我们知道通过继承DispatchAction可以实现把 ...

随机推荐

  1. R语言学习笔记:分析学生的考试成绩

    孩子上初中时拿到过全年级一次考试所有科目的考试成绩表,正好可以用于R语言的统计分析学习.为了不泄漏孩子的姓名,就用学号代替了,感兴趣可以下载测试数据进行练习. num class chn math e ...

  2. 我的Fitbit Force手环使用体验

    2013年底,从淘宝上代购了Fitbit Force二代,下手前也对比了当时的几个类似产品,好像记得Nike新款暂时在国内还买不到,就买下了这个,1020元,时至今日好像只需六.七百了.当时看中它的主 ...

  3. EdgesForExtendedLayout

    在IOS7 之后viewController有一个新的属性叫做edgesForExtendedLayout,这个属性指定viewController的view边缘延伸的方向,默认情况下是UIRectE ...

  4. IOS 杂笔-8(loadView、viewDidLoad、viewWillAppear、viewDidAppear等简介)

    loadView; This is where subclasses should create their custom view hierarchy if they aren't using a ...

  5. Gleeo Time Tracker简明使用教程

    转载一篇很不错的文章,这款软件还是非常实用的 1 简介 Gleeo Time Tracker是安卓平台下一款相当酷的项目时间记录和管理的软件.说他酷,是因为界面纯黑.而除了这点酷之外,功能也很简单实用 ...

  6. tomcat下部署润乾报表

    因为项目需要,需要在项目中配置润乾报表,之前一直是用的jboss服务器,此处调整为tomcat时出错,然后各种找错,找答案,最后终于好了,然后总结一下. 首先在apache-tomcat-6.0.43 ...

  7. 关于Redis中的Replication

    一.简介 Redis的replication机制允许slave从master那里通过网络传输拷贝到完整的数据备份.具有以下特点: 异步复制 可以配置一主多从 可以配置从服务器可以级联从服务器,既 M- ...

  8. java代码调用oracle存储过程

    一.简介 与调用mysql存储过程类型过程都是如下 1.创建连接 Connection conn = DriverManager.getConnection(url, user, password); ...

  9. Linux Crash/Hang on Bay Trail/J1900/N2940

    近几年的linux kernel, 尤其是4.1以后,在Bay Trail平台上会随机挂起和死机,亲测j1900,死机非常频繁,而且死机前毫无征兆,直接就挂起了,console也没有相应. 这个问题在 ...

  10. 重载 && 重载递增递和减运算符

    class Rule { private: double m_Length; public: explicit Rule(double lg = 1.0) :m_Length{ lg }{} Rule ...