08SpringMvc_(1)继承AbstractCommandController的Action[能够以实体的形式,收集客户端参数].(2)日期转换器和编码过滤器

时间:2021-11-21 22:16:40

上一篇文章说过要介绍两个控制器。这篇文章就介绍第二个控制器AbstractCommandController(这个类已经快要被废弃了,有更好的代替者,但还是要好好学这个类)。这个控制器的额作用是为了收集提交的参数,

比如说之前的写法是://获取员工的姓名 String username=request.getParameter("username");这样去收集参数,提交的参数一多这样很不方便,所以引入了AbstractCommandController。记住SringMVC中的Action是单例模式,Strut2中的Action是多例模式,所以这就造成了他们收集参数的方式是绝对不同的。

案例如下:

案例结构图:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAAF8CAIAAACSYpPtAAAgAElEQVR4nO2dW3ATV57/lYd52weqSNXsPuzsJJUhZKgJCRN7s9pshlz+f8h//rVJZYoEV4IhzIwmhAwXJxnsJU5swOAYWDqJDSYEMAsmCthcoqBAwBjGAWzHwRcuduz4IttgW5aErnbLMvQ+tNQ63X36Irsl9eX3qfMgtU5fBP3xOd3q8z0mSpVcunQpGAzKrPw/WQ9ePbq1/fSu9jPlVyo27FuzmF5uum/7zI03knaMymG3mMxEV2rWApKPKd0HoACXNs6ryHqAKZ8u+pd0H5EkXYTZYo++tltMMu2Y2lpAqtGDVBzWPvVz+oXpvu2mnx9I78EI0kWYTVEScGNqawGpRYdSAUB6AakAQGFAKgBQGJAKABQGpAIAhQGpAEBhQCoAUBgdSsX8TqUTugizwj9KpfVZDOW/jurQg1S1Gx6/+F+/Ycqni/4FfVu74fF0H+D0ULtUXYTZZGKe9JBVfRp77yLMqv/hWw9SXVw3p6t2362GA7caDlw9unXfmsXo24vr5qT7ANWGolJ1EWaz2SxhVRchVSOhnYFU06K2tra4uFiiznu/vtVwIOw762493H561741i9G3te/9OjWHqh2UlKqLMJuJLrtF3BllpGL2BVJNnZqamjlz5syaNUu82tm1v77VcMDdetjderj9TDktFfP27FphqZxWa/6KJqfkgdgt3Cfu4kuQro/dYjIT9ujjeRZ7vBbuJ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WVdXZ0DMCr9PKJS8T+Q5NatW5WVlYODg8FgMGBg+vv7KysrbwFG5Tab4eHhqFRDsmFWdjqdO3fuDIVCgUAwEAj4/fHi8/l9Pj+6RE+F/nY+n9/r9Xk8Ho/nzu7du52AYRjF4YrhdrujUo2wcTqd9AuPx+Pz+TwezwgPt9u9a9euYDAUCAR8Pp83Vfj9gWAwFAyGsC9Sdhher9fjueN0ulwu9549e9yAUfF4PH6/PxgM+v1+j8dz584dMalooxYtWuTz+YSkCgSCXq/P47njcrlTU/z+wL+bzZY//5nzYkNhod8fSNlhuFxup9M1NDzidDpBKiPj8XiCweBjjz1GeyUmFW3UAw88sG7dOlGpAp47XpfL7XSOpqb4fP4/Ll9+oKKC8+LE8eM+nz9lh+F0jg6POG/dHgKpDA4t1a9+9atFixbRXuGloo36xS9+8cILL+zdu1dEKr8/4HZ7nM7R4eGR1BSv15u7bt3Jkyc5L86fP+/1elN2GMPDI7dvDw0O3hoZGQGpjAwj1dKlS997771QKISXyu/3/+Y3v8nIyMjLyzt27JiIVCMjzr4+R2fnTzdvdqSmDA7eol3ivDh//vzg4K2UHcbNmx3Xr99sbmn7sbMTpDIytFSzZ8/Oy8v78ssvq6qqxFqq1157bdu2bd98842IVMPDI93dve3tP7a13UhNcTgGaJc4L86fP+9wDKTsMNrabrS0XGtqutre/iNIZWRoqZ566qnKysqmpibBloq5ptq8eXNtba2IVENDw52dP127dvPq1dbUlJ6evo8JoqamhvPiypUrPT19KTuMq1dbv29qrq///ubNdpDKyNBSWSyW2tpasWsq9O6f3W4Xker27aH29s7m5rbGxh9SU376qefE8eONjY2cF62trT/91JOyw2hs/KG+/vvvvrty/fpNkMrI0FJt27aNufv3vwX6AEgbP8IbAAAAAElFTkSuQmCC" alt="" />

先给出具体代码实现,在进行讲解。

第一步:先写index.jsp.

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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>
<form action="${pageContext.request.contextPath}/adduser.action" method="post">
<table border="2" align="center">
<tr>
<th>姓名</th>
<td> <input type="text" name="username" /></td>
</tr> <tr>
<th>性别</th>
<td> <input type="radio" name="gender" value="男" />男
<input type="radio" name="gender" value="女" checked/>女
</td>
</tr>
<!-- <tr>
<th>入职时间</th>
<td> <input type="text" name="username" /></td>
</tr>
-->
<tr>
<td>
<input type="submit" value="提交">
</td> </tr>
</table> </form> </body>
</html>

第二步:写Emp.java,这个文件里面的属性就是要和前面的jsp页面提交的数据要完全吻合(名字必须要一模一样)。就是为了收集页面数据的。

package com.guigu.shen.Action4;

public class Emp {
//名字(与表单中的name属性必须要一模一样)
private String username;
//性别
private String gender;
/**
* @return the username
*/
/**
*
*/
public Emp() {
// TODO Auto-generated constructor stub
}
public String getUsername() {
return username;
}
/**
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @return the gender
*/
public String getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(String gender) {
this.gender = gender;
}
}

第三步:写EmpAction.java

package com.guigu.shen.Action4;

import javax.jws.WebParam.Mode;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController; public class EmpAction extends AbstractCommandController{
/**
* 我们知道SpringMvc的Action是单例模式的,所以他收集从页面传过来的参数的方式与Struts2不一样
* SpringMVC能够以实体的形式,收集客户端参数
*/
//mvc会走无参的构造器,可以通过里面的代码(this.setCommandClass(Emp.class);),匹配jsp页面中的参数信息
public EmpAction() {
//第一步:自动将表单参数封装到Emp对象中
this.setCommandClass(Emp.class);
System.out.print("EmpAcion的无参构造函数");
} /*
* 参数command表示可以分装好的实体类(Emp)
*
*/
@Override
protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception { ModelAndView modelAndView=new ModelAndView(); //第二步:command就是Emp对象传进来的。
System.out.println("handle方法");
Emp emp=(Emp) command;
modelAndView.addObject("message", "增加员工成功");
System.out.println("员工的名字"+emp.getUsername());
System.out.println("员工的性别"+emp.getGender());
modelAndView.setViewName("/jsp/success.jsp"); return modelAndView;
} }

第四步:springmvc_004.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"
>
<!-- 控制器(程序员)(必须配置) --> <bean name="/adduser.action" class="com.guigu.shen.Action4.EmpAction"></bean>
<!-- 映射器 -->
<!-- 适配器
SimpleControllerHandlerAdapter不仅能去找实现了Controller接口的Action
还能去找继承了AbstractCommandController类的Action --> </beans>

第五步:springmvc.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/Action4/springmvc_004.xml"/>
</beans>

第六步: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>
<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:springmvc.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>

运行:输入:http://127.0.0.1:8080/SpringMvc_10day_self/

结果是:正常运行。但是有一个问题。控制台从网页那边得到的中文乱码:

员工的名字?¨???±??±
员工的性别???

先不管这个,我们讲一下这个案例的执行流程:我们要现实的功能其实就是从index.xml页面上输入员工的姓名和性别。然后在EmpAtion中得到这些属性。这里用的是在EmpAction中定义Emp这么一个类,然后由这个类会自动去装配信息。

-------------------------------------------------------------------------------------------------------------------------------------------------------------

好,介绍好流程以后,我们再来解决一下上面的乱码问题。我们以前解决这种问题通常是在EmpAction.java中加一句request.setCharacterEncoding("utf-8");

我们先试试看这样可以吗?试了,答案是不可以。

Spring提供了一个Filter专门用来解决Post提交中文的乱码问题。需要在web.xml中配置。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnkAAAF8CAIAAAA8TjrYAAAgAElEQVR4nO3dza7zSGKfcd5VA9zoUnojEH0TjrTRurkh5CvQhhCSwAAd44WnQUFJACdOVmYcyIs5sDHuHmUGiCcZO94wC4pkfVeRRyVROs8PLxrniCyyKJbqryryNJMWAADElDy7Ap+VJNMOYVhfLGjbiPL61H1Nqs/jfWbXT6z2JPPqOaNUeJHZb90d3/PlnL7ELnxNR6mhbPxDeb7Aw5zdrd33bZx3Kl/XyzdNJTK9Zyt5tawNb5FT267yumNlY9mZB/xYU5uHseDUHd1xZeUEBa4fcozdoqmNyvjKvUx6WyaVepXm+nnh78akduVd09aKHE3FWIEZtXoVno9iFJc8TdL8cp+NOT51xkNwn2B38bv0MrbezdsiQ34NXNROb+jiIm+dlyOweXhPin6YU8+jbde2FYx7dKwZ0ngC2d40x5s5by9T3/Pwmnxm49NVWZJk1Z029rnthzQt2w/GlSe9gYmc4u6KGSsQUqsXlST22It1tHfKWv2sBzYF45qJsydttXfjLm9OyEbc+3V/TryLbFtzvHX6r8YdVZn69uqdhbSOunhYmOaXtsrzS9dwjEytaUbzmCT8vJjrHFCZeefae2q8B+6ofOAWQugb8b4y4z28V23tbg01Wta6tj+jaYkn0fsGulugbf3AVjfvb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AADERdYCABAXWQsAQFxkLQAAcZG1AADERdYCABAXWQsAQFxk7QTGx4ZbNaX+gDPwtgD4gsjaYObHhkuPGJP+B/HGULnWa8Nzyr4SshbA10PWqqqj+sDwjnFQqz5VO5T1UeHi47vh02TbbXLkCTgAlo6sHVXHbWLru82D2tkPOyNr78Z11gBgGcjatm3by2nv7q/1Qe1HXayE2ePVZrMq+zX8E8WmrB1LGZ+hJk1Wi3nc16Q8C+t4vgE05WqzWRXF7rZyX3A4hG4FrRrd893G9TebVVEPW3Uvtb4tt8rU48PjSqn2w+vr+trvQj2gLnHTE19TACzRV8/aW8qaxqwjy6C29YxrrYPXGePaQyHt6FAoc9fNzhKxwtNP5fy71utu/eEHqVbNedjUtV4LtT2X0o4+6kIMVPdS67Ff67XwBUI8WPFID4XnGa75nsQFsERfPWs7l9M+2e5zSxftuP34QVlrGPLKQ0bXviyu9fq2haGssBF1j1LWKjU8l2P+uZdaqzpW5raR27sqv962zc6WtddTSsoCWCqytnc9pVvTXVH2QW37yKxVR4fh+7JwZa0SadLG9UMWX3EvtVY1NGvbQ6FnbZNtt46vSgDwdGStrDkmcuJWR9ff1EbN2o+6GAaU6nixKSOOaw2TxtZf9Zh0LLVW1Za18nzyR10o17Cz7TbZTvmjZwB4BrLW6XpKLYNa/d4o+bKieb7XsahnubFILTteWN2p08uuK5p9oVLYTreF4YficJWPrix3wmbP5WZXmu+cci+1HrtUmdsVX+H9lN4Q07gWAJaOrHVxD2q/JvefOc39I6hQZC2AV0TWYppnZq08uQ0Ar4KsxQTCPLBhfOleGmmnALB8ZC0AAHGRtQAAxEXWAgAQ14KyFgCAd7WIrAUA4F39qAksSNYCABBECVeyFgCAOyNrAQCIi6wFACAushYAgLi4NwoAgIUiawEAiIusBQAgLrIWAIC4yFoAAOIiawEAiIusBQAgLrIWAIC4yFoAAOL6/8KkH09U97kgAAAAAElFTkSuQmCC" alt="" />

好,我们按照上面的做法去试试。

修改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:springmvc.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>

输出:员工的名字爱爱
       员工的性别女

问题解决了。

---------------------------------------------------------------------------------------------------------------------------------------------------------------

这个问题解决了,我们在加一个功能,在员工的入职日期也加进去。在index.xml中修改代码。如下:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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>
<form action="${pageContext.request.contextPath}/adduser.action" method="post">
<table border="2" align="center">
<tr>
<th>姓名</th>
<td> <input type="text" name="username" /></td>
</tr> <tr>
<th>性别</th>
<td> <input type="radio" name="gender" value="男" />男
<input type="radio" name="gender" value="女" checked/>女
</td>
</tr>
<tr>
<th>入职时间</th>
<td> <input type="text" name="userdata" value="2015-3-2" /></td>
</tr> <tr>
<td>
<input type="submit" value="提交">
</td> </tr>
</table> </form> </body>
</html>

然后在Emp.java中也修改代码,多一个Data userdata属性。

package com.guigu.shen.Action4;

import java.util.Date;

public class Emp {
//名字
private String username;
/**
* @return the userdata
*/
public Date getUserdata() {
return userdata;
}
/**
* @param userdata the userdata to set
*/
public void setUserdata(Date userdata) {
this.userdata = userdata;
}
//性别
private String gender;
private Date userdata;
/**
* @return the username
*/
/**
*
*/
public Emp() {
// TODO Auto-generated constructor stub
}
public String getUsername() {
return username;
}
/**
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
/**
* @return the gender
*/
public String getGender() {
return gender;
}
/**
* @param gender the gender to set
*/
public void setGender(String gender) {
this.gender = gender;
}
}

再在EmpAction.java中加一句   System.out.println("員工的入職日誌"+emp.getUserdata().toLocaleString());

package com.guigu.shen.Action4;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController; /*
* Create by 沈晓权
* Create on 2016年8月7日下午8:28:10
*/
public class EmpAction extends AbstractCommandController{
/**
* 我们知道SpringMvc的Action是单例模式的,所以他收集从页面传过来的参数的方式与Struts2不一样
* SpringMVC能够以实体的形式,收集客户端参数
*/
//mvc会走无参的构造器,可以通过里面的代码(this.setCommandClass(Emp.class);),匹配jsp页面中的参数信息
public EmpAction() {
//第一步:自动将表单参数封装到Emp对象中
this.setCommandClass(Emp.class);
System.out.print("EmpAcion的无参构造函数");
} /*
* 参数command表示可以分装好的实体类(Emp)
*
*/
@Override
protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception { ModelAndView modelAndView=new ModelAndView(); //第二步:command就是Emp对象传进来的。
System.out.println("handle方法");
Emp emp=(Emp) command;
modelAndView.addObject("message", "增加员工成功");
System.out.println("员工的名字"+emp.getUsername());
System.out.println("员工的性别"+emp.getGender());
System.out.println("員工的入職日誌"+emp.getUserdata().toLocaleString());
modelAndView.setViewName("/jsp/success.jsp"); return modelAndView;
} }

运行之后:结果不行。直接出错。

 Request processing failed; nested exception is java.lang.NullPointerException
出错的原因是在收集从index.xml的数据时出错了,导致Emp没有被实例化,然后造成空指针了。 怎么解决呢?

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmgAAADICAIAAADTDorZAAAgAElEQVR4nO2dO47kSJKGeZ66QAM8R+cNGo4+QColZd2gmUJKNX2CFFIqKis0EmgpldJSoTDCTKG6UTsL7DS2Z3YVrsCXmbmZuTuDjFf+HwqFCPrL3Pzx052ewaoHAAAAQDbVqQ0AAAAALgkIJwAAAFAAhBMAAAAoAMIJAAAAFFAmnFW1pdCquTlFxEHb2gM2RzSQ31409OJa9kCDM/t2USlD5HPz5OaO2jurdSWuaKnV8ZPJD3Fafj+0Sika1xVHvXIObCmclYaftkgL5yC/oGRMYVUOTq3fCCsc5TSu6lWnXXao0AZURvdWDVZ9RR3iZO5fTJp3cgfu6qitDPPjFM0MK4zMt8T/vCLyCocXdc6kqX7kouRHo0z//d7jfJizivNPXjkkclED+0FHomvqqm66E1uRSaYnaX+Iu0Gy22xlbd9v717f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EEwAAACgAwgkAAAAUcL3CWfROeQAAACCPKxXOQTpxQggAAMDWXKlwYsUJAABgH65XOPGMEwAAwA5AOAEAAIACIJwAAABAAdconPjlIAAAALtxjcIJAAAA7AaEEwAAACgAwgkAAAAUAOEEAAAACthLOAEAAIBrZXvhBAAAAK6VnyL8+BBOAAAAbxqhlBBOAAAAwAPCCQAAABQA4QQAAAAKgHACAAAABeBwEAAAALAjEE4AAACgAAgnAAAAUACEEwAAACgAwgkAAAAUAOEEAAAACoBwAgAAAAVAOAEAAIACIJwAAABAAf8Pluq/VB9hajgAAAAASUVORK5CYII=" alt="" />

当然,不一定要是yyy-MM-dd这种形式的,是可以改的。
我们修改下代码:
package com.guigu.shen.Action4;

import java.text.SimpleDateFormat;
import java.util.Date; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.crypto.Data; import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.validation.BindException;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController; public class EmpAction extends AbstractCommandController{
/**
* 我们知道SpringMvc的Action是单例模式的,所以他收集从页面传过来的参数的方式与Struts2不一样
* SpringMVC能够以实体的形式,收集客户端参数
*/
//mvc会走无参的构造器,可以通过里面的代码(this.setCommandClass(Emp.class);),匹配jsp页面中的参数信息
public EmpAction() {
//第一步:自动将表单参数封装到Emp对象中
this.setCommandClass(Emp.class);
System.out.print("EmpAcion的无参构造函数");
} /*
* 参数command表示可以分装好的实体类(Emp)
*
*/
@Override
protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception { ModelAndView modelAndView=new ModelAndView(); //第二步:command就是Emp对象传进来的。
System.out.println("handle方法");
Emp emp=(Emp) command;
modelAndView.addObject("message", "增加员工成功");
System.out.println("员工的名字"+emp.getUsername());
System.out.println("员工的性别"+emp.getGender());
System.out.println("員工的入職日誌"+emp.getUserdata().toLocaleString());
modelAndView.setViewName("/jsp/success.jsp"); return modelAndView;
} @Override
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception {
/*
向springmvc内部注入一个自定义的类型转换器
参数一:将String转换成什么类型的字节码
参数二:自定义转换规则
*/
binder.registerCustomEditor(Date.class,new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true) );
} }

问题解决了。

---------------------------------------------------------------------------------------------------------------------------------------------------------------

最后我们再实现一个功能:把emp这个类封装到modelAndView。传递给success.jsp然后在success.jsp中把emp里面的数据显示出来。

EmpAction.java改为

/**
* Create by 沈晓权
* Create on 2016年8月7日下午8:28:10
*/
package com.guigu.shen.Action4; import java.text.SimpleDateFormat;
import java.util.Date; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.crypto.Data; import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.validation.BindException;
import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController; /*
* Create by 沈晓权
* Create on 2016年8月7日下午8:28:10
*/
public class EmpAction extends AbstractCommandController{
/**
* 我们知道SpringMvc的Action是单例模式的,所以他收集从页面传过来的参数的方式与Struts2不一样
* SpringMVC能够以实体的形式,收集客户端参数
*/
//mvc会走无参的构造器,可以通过里面的代码(this.setCommandClass(Emp.class);),匹配jsp页面中的参数信息
public EmpAction() {
//第一步:自动将表单参数封装到Emp对象中
this.setCommandClass(Emp.class);
System.out.print("EmpAcion的无参构造函数");
} /*
* 参数command表示可以分装好的实体类(Emp)
*
*/
@Override
protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception { ModelAndView modelAndView=new ModelAndView(); //第二步:command就是Emp对象传进来的。
System.out.println("handle方法");
Emp emp=(Emp) command;
modelAndView.addObject("message", "增加员工成功");
System.out.println("员工的名字"+emp.getUsername());
System.out.println("员工的性别"+emp.getGender());
System.out.println("員工的入職日誌"+emp.getUserdata().toLocaleString());
modelAndView.addObject("emp", emp);
modelAndView.setViewName("/jsp/success.jsp"); return modelAndView;
} /* (non-Javadoc)
* @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest, org.springframework.web.bind.ServletRequestDataBinder)
*/
@Override
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception { binder.registerCustomEditor(Date.class,new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true) );
} }

success.jsp改为:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
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>
${message}
姓名:${requestScope.emp.username }</br>
入职时间:${requestScope.emp.userdata }</br>
</body>
</html>

运行结果为:增加员工成功 姓名:爱爱
             入职时间:Mon Mar 02 00:00:00 CST 2015

发现入职时间这个显示格式不好。我们修改一下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>
${message}
姓名:${requestScope.emp.username }</br>
入职时间:${requestScope.emp.userdata }</br>
<!-- 1)fmt:formatDate 来源于http://java.sun.com/jsp/jstl/fmt
2)fmt:formatDate作用是格式化日期的显示。例如2015年5月10号 星期五
3) value表示需要格式化的值
4)typez表示现实的日期,时间都要显示
type=data表示只显示 日期
type=time 表示只显示时间
type=both 时间个日期都要显示
dateStyle="full"这个有好几种格式,看具体的要求
-->
入职时间:<fmt:formatDate
value="${requestScope.emp.userdata}"
type="date"
dateStyle="full"
/>
</body>
</html>

运行结果是:

增加员工成功 姓名:爱爱
入职时间:Mon Mar 02 00:00:00 CST 2015

入职时间:2015年3月2日 星期一

结束。

08SpringMvc_(1)继承AbstractCommandController的Action[能够以实体的形式,收集客户端参数].(2)日期转换器和编码过滤器的更多相关文章

  1. 关于继承modelDriven接口action的ajax来电参数

    例如   Model类如下面,Teacher,public class Teacher{  private Integer id. priavte  String name;  private Sch ...

  2. 限制action所接受的请求方式或请求参数

    原文:http://www.cnblogs.com/liukemng/p/3726897.html 2.限制action所接受的请求方式(get或post): 之前我们在HelloWorldContr ...

  3. 控制器中的Action方法,接收浏览器传过来的参数,总共有几种?

    1.根据配置文件中的URL规则 public ActionResult Delete(int id) //id参数就是根据路由里面的参数id来传过来的,这个action方法中的参数一定要和路由中的id ...

  4. Struts2中的链接标签 &lt&semi;s&colon;url&gt&semi;和&lt&semi;s&colon;a&gt&semi;---在action中获取jsp表单提交的参数&lpar;转&rpar;

    转自:http://sgl124764903.iteye.com/blog/444183 1.普通链接 Web程序中最普通的应用是链接到其他页面,下面看Welcome.jsp. <%@ page ...

  5. SSH框架下ajax调用action并生成JSON再传递到客户端【以get和post方式提交】

    需要完成的任务: 主要是把JSP页面上图片ID传给服务器端,服务器读取cookie看是否有username,如果有则根据ID读取MongoDB数据库,读出图片URL,再存放到mysql中的collec ...

  6. jQuery find&lpar;&rpar; 搜索所有段落中的后代 C&num; find&lpar;&rpar; 第一个匹配元素 Func 有返回值 Action是没有返回值 Predicate 只有一个参数且返回值为bool 表达式树Expression

    所有p后代span Id为 TotalProject 的 select 标签 的后代 option标签 为选中的 text using System; using System.Collections ...

  7. Spring MVC学习总结

    Spring MVC学习总结 Spring MVC学习路(一) 下载配置文件 Spring MVC学习路(二) 设置配置文件 Spring MVC学习路(三) 编写第一个demo Spring MVC ...

  8. springmvc 学习笔记&lowbar;1

    一.回顾JavaWeb中的MVC设计模式 1)MVC这种设计模式,不光运用于Web领域,而且也能用于非Web领域 2)今天说的MVC特指一种表现层设计模式,不限于Java语言 二.回顾struts2+ ...

  9. 30、springmvc

    第一章回顾JavaWeb中的MVC设计模式 1)MVC这种设计模式,不光运用于Web领域,而且也能用于非Web领域 2)今天说的MVC特指一种表现层设计模式,不限于Java语言 第二章回顾struts ...

随机推荐

  1. ubuntu firefox 选中变成了删除

    在ubuntu下 我的firefox浏览器出现了问题.描述: 1.在firefox中所有能够删除的文字只要选中就自动删除了. 终端中 ibus-setup勾掉在应用窗口中启用内嵌编辑模式

  2. samba服务日志文件-密码文件及启停

    1.Samba服务日志文件日志文件对于samba非常重要,它存储着客户端访问samba服务器的信息,以及samba服务的错误提示信息等,可以通过分析日志,帮助解决客户端访问和服务器维护等问题.在/et ...

  3. Centos下安装jdk详解

    环境: 系统: [root@Wulaoer ~]# cat /proc/version Linux version 2.6.32-431.el6.x86_64 (mockbuild@c6b8.bsys ...

  4. CentOS 6&period;5搭建Samba服务器

    目标需求:在Windows7下访问CentOS 6.5 root用户桌面/ZS文件夹 0.准备工作 关闭防火墙并开启不起动 service iptables stop chkconfig iptabl ...

  5. LeetCode 380&period; Insert Delete GetRandom O&lpar;1&rpar; (插入删除和获得随机数 常数时间)

    Design a data structure that supports all following operations in average O(1) time. insert(val): In ...

  6. UWP 磁贴设置

    一:需求 一款好看好用的应用,对于UWP来说,动态的磁贴必不可少. 二:TileUpdateManager类 和TileUpdater类 如果需要更改或更新应用的磁贴,那么首先需要获得TileUpda ...

  7. &lbrack;bzoj1063&rsqb;&lbrack;Noi2008&rsqb;道路设计

    来自FallDream的博客,未经允许,请勿转载,谢谢. Z国坐落于遥远而又神奇的东方半岛上,在小Z的统治时代公路成为这里主要的交通手段.Z国共有n座城市,一些城市之间由双向的公路所连接.非常神奇的是 ...

  8. FreeMarker案例

  9. &lbrack;转&rsqb; 指定进程运行的CPU

    转自:https://www.cnblogs.com/liuhao/archive/2012/06/21/2558069.html coolshell最新的文章<性能调优攻略>在“多核CP ...

  10. 【58沈剑架构系列】lvs为何不能完全替代DNS轮询

    上一篇文章“一分钟了解负载均衡的一切”引起了不少同学的关注,评论中大家争论的比较多的一个技术点是接入层负载均衡技术,部分同学持这样的观点: 1)nginx前端加入lvs和keepalived可以替代“ ...