Spring SpringMVC Mybatis 项目总结

本文详细介绍了Mybatis的基本概念、在项目中的应用部分,包括如何获取插入数据的主键,Mapper映射文件的注意事项,以及如何进行多表关联查询。接着,概述了SSM(SpringMvc+Spring+Mybatis)的搭建步骤,并讨论了分组项目的maven多模块搭建流程。同时,涉及了分页查询、Velocity模板引擎的使用,百度地图API的应用,以及Lucene的介绍和项目中的实践。此外,还讲解了第三方登录(以微信为例)的实现流程和Shiro的安全框架,特别是多Realm的配置和应用场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mybatis

mybatis是什么?

mybatis是一款基于java的持久层框架,支持定制化sql,存储过程以及高级映射。可以使用简单的XML或注解配置来映射原生信息

用在哪一层?

 java持久层

使用mybatis,你的项目中,与mybatis相关的有那几部分?

数据库和spring集成mybatis

Mybatis怎么获取一个插入数据的主键?

第一种方式

<insert id="insertAndGetId" useGeneratedKeys="true" keyProperty="userId" parameterType="com.chenzhou.mybatis.User">
    insert into user(userName,password,comment)
    values(#{userName},#{password},#{comment})
</insert>
useGeneratedKeys=“true” 表示给主键设置自增长
keyProperty=“userId” 表示将自增长后的Id赋值给实体类中的userId字段

第二种方式

<insert id="insertProduct" parameterType="domain.model.ProductBean" >
       <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="productId">
          SELECT LAST_INSERT_ID()
      </selectKey>
        INSERT INTO t_product(productName,productDesrcible,merchantId)values(#{productName},#{productDesrcible},#{merchantId});
    </insert>
order=“AFTER” 表示先执行插入语句,之后再执行查询语句.可被设置为 BEFORE 或 AFTER。如果设置为BEFORE,那么它会首先选择主键,设置 keyProperty 然后执行插入语句。
如果设置为 AFTER,那么先执行插入语句,然后是 selectKey 元素-这和如 Oracle 数据库相似,可以在插入语句中嵌入序列调用
keyProperty=“userId” 表示将自增长后的Id赋值给实体类中的userId字段。SELECT LAST_INSERT_ID() 表示MySQL语法中查询出刚刚插入的记录自增长Id.实体类中uerId 要有getter() and setter(); 方法

Mybatis的mapper映射文件:注意事项有哪些?

mapper映射文件中所有的sql语句id需要对应接口类中的方法名
设置参数时若配置文件中没有定义别名,需要引入参数的全限定名。其他数据类型需要查询mybatis与java的对应数据类型表

Mybatis中实现多表的关联查询:怎么做?????

嵌套查询
嵌套查询就是通过另一个sql映射语句获取到结果封装到ResultMap中

//property:关联集合
//ofType:"集合中元素类型"
//select:通过这个关联sql查询对应数据集合
//column:关联对象表中的外键,对应当前对象主键的id
<collenction property="users" ofType="User" column="id" select="全限定名.sql映射语句Id"></collenction>

嵌套结果

嵌套结果就是发一条关联sql解决问题,映射文件Mapper结果的手动封装ResultMap
使用嵌套结果映射来处理重复的联合结果的子集。这种方式,所有属性都要自己来!

//property:关联对象所在类中的属性
//javaType:关联对象类型
 <association property="department" javaType="Department">
 //column:结果集中列名
//property:关联对象属性
    <id column="did" property="id"/>
    <result column="dname" property="name"/>
</association>

SSM(SpringMvc+Spring+Mybatis)的搭建的步骤:

1.项目中导入spring的jar包,创建一个applicationContext.xml配置文件
  <?xml version="1.0" encoding="UTF-8"?>

<import resource="classpath*:application-mapper.xml"/>
<!--扫描的包-->
<context:component-scan base-package="cn.itsource.crm.service"/>
<!-- 事务管理器 -->
<bean id="transactionManager"
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
</bean>
<!--注解是事务:crm-service层非base方法,可以使用-->
<tx:annotation-driven transaction-manager="transactionManager"/>
<!-- aop应用事务管理:注意针对basic-core上的BaseService层事务 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <tx:method name="find*" read-only="true" />
        <tx:method name="get*" read-only="true" />
        <tx:method name="select*" read-only="true" />
        <tx:method name="load*" read-only="true" />
        <tx:method name="search*" read-only="true" />
        <tx:method name="query*" read-only="true" />
        <tx:method name="*" propagation="REQUIRED" />
    </tx:attributes>
</tx:advice>
<aop:config>
    <!--
    所有service事务
    <aop:pointcut expression="execution(* cn.itsource.*.service..*.*(..))"-->
    <!--id="servicePointcut" />-->
    <!--只针对basic事务-->
    <aop:pointcut expression="execution(* cn.itsource.basic.service..*.*(..))"
                  id="servicePointcut" />
    <aop:advisor advice-ref="txAdvice" pointcut-ref="servicePointcut" />
 </aop:config>
</beans>

2.导入springMVC的jar包,创建一个applicationContext-mvc.xml文件

     <?xml version="1.0" encoding="UTF-8"?>

<!-- 开启springmvc对注解的支持 -->
<mvc:annotation-driven/>

<!-- 使用默认的静态资源处理Servlet处理静态资源,需配合web.xml中配置静态资源访问的servlet -->
<mvc:default-servlet-handler/>

<!-- 自动扫描springmvc控制器 -->
<context:component-scan base-package="cn.itsource.crm.web.controller"/>
<context:component-scan base-package="cn.itsource.crm.log"/>
<!-- 视图解析器 -->
<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/views/"/>
    <property name="suffix" value=".jsp"/>
</bean>

<!-- 文件上传解析器 -->
<bean id="multipartResolver"
      class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="maxUploadSize" value="#{1024*1024*100}"></property>
</bean>

<!-- 配置jackson处理JSON数据 -->
<bean id="stringConverter"
      class="org.springframework.http.converter.StringHttpMessageConverter">
    <constructor-arg value="UTF-8" index="0"/>
    <property name="supportedMediaTypes">
        <list>
            <value>text/plain;charset=UTF-8</value>
        </list>
    </property>
</bean>
<bean id="jsonConverter"
      class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"></bean>

<!--aop日志管理配置-->

<aop:aspectj-autoproxy proxy-target-class="true"/>
   <bean id="userLogAopAction" class="cn.itsource.crm.log.UserLogAopAction"/>
</beans>

3.spring集成mybatis,导入mybatis的jar包,在资源文件夹中准备一个xml。applicationContext-mapper.xml

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

    <!-- 配置属性资源文件 -->
    <context:property-placeholder location="classpath*:jdbc.properties"/>

    <!-- 配置连接池 -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="username" value="${jdbc.username}"></property>
        <property name="password" value="${jdbc.password}"></property>
        <property name="url" value="${jdbc.url}"></property>
        <property name="driverClassName" value="${jdbc.driverClassName}"></property>
    </bean>
    <!-- 配置mybatis sqlsessionfactory -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 配置数据源 -->
        <property name="dataSource" ref="dataSource"/>
        <!-- 配置mybatis的映射器的路径 -->
        <property name="mapperLocations"
                  value="classpath*:cn/itsource/crm/mapper/*Mapper.xml"/>
        <!-- 配置需要取类型别名的包名; -->
        <property name="typeAliasesPackage" value="cn.itsource.crm.domain,cn.itsource.crm.query"/>
        <property name="plugins">
            <array>
                <bean class="com.github.pagehelper.PageInterceptor">
                    <property name="properties">
                        <value>
                            helperDialect=mysql
                        </value>
                    </property>
                </bean>
            </array>
        </property>
    </bean>
    <!-- 配置自动扫描mybatis映射器,自动创建映射器对象 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 会根据cn.itsource.crm.mapper包中定义的接口,自动创建Mapper对象;bean的名为接口的名字(首字母小写) -->
        <property name="basePackage" value="cn.itsource.crm.mapper"/>
    </bean>
</beans>

分组项目:

1.svn是什么?

SVN是Subversion的简称,是一个开放源代码的版本控制系统。简单的说就是多人开发一个系统,共享资源的同时控制版本
  1. 怎么用?
svn分为服务器和客户端
    svn服务器直接安装运行就可以了,这里注意点端口的问题。不要与其他服务端口冲突了
TorotiseSVN客户端(小乌龟)安装好之后将项目导入到svn服务器
之后从svn检出到自己的开发环境中(先更新再提交)冲突之后mark解决冲突一般需要协商好之后由负责人解决

maven多模块怎么搭建

1.创建一个项目
2.选中该项目中创建maven子模块(多个方式一样,web层可以创建maven web项目)
3. 父模块与其他子模块的关系管理,pom.xml文件中

<modules>
        <module>crm-mapper</module>
        <module>crm-common</module>
        <module>crm-service</module>
        <module>crm-web</module>
        <module>basic-util</module>
        <module>basic-core</module>
        <module>basic-generator</module>
        <module>crm-shiro</module>
</modules>

4.子模块与子模块直接的依赖管理,pom.xml文件中

   ···
<dependencies>
        <dependency>
            <groupId>cn.itsource.crm</groupId>
            <artifactId>crm-shiro</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>cn.itsource.crm</groupId>
            <artifactId>crm-service</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
···

分页查询流程

1.根据前台传入的分页参数做一个封装类

       /**
 * 分页数据封装类
 * @author solargen
 * @param <T>
 */
public class PageList<T> {

    private Long total = 0L;
    private List<T> rows = new ArrayList<>();

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public PageList() {
    }

    public PageList(Long total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }
}

2.准备一个接收条件参数的类

            public class BaseQuery {
    //当前页
    private int page = 1;
    //每页显示条数s
    private int rows = 5;
    //查询传递的字段
    private String keyword;
····

3.导入分页插件

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>5.0.1</version>
</dependency>

4.利用前台参数和分页插件查询并封装数据返回

/**
 * 为了使用分页插件,必须导入依赖,只是为了编译不报错
 * @param query
 * @return
 */
@Override
public PageList<T> queryPage(BaseQuery query) {
    Page<T> objects = PageHelper.startPage(query.getPage(), query.getRows());
    //拿到分页后的总数据
    getMapper().selectByQuery(query);
    return new PageList<>(objects.getTotal(), objects.getResult());
}

Velocity的使用步骤?

Velocity是一个基于java的模板引擎(template engine)。它允许任何人仅仅使用简单的模板语言(template language)来引用由java代码定义的对象。

1.去官网下载Velocity的jar包,放到java项目的lib目录下
2. 初始化模板引擎
      package cn.itsource.basic;

import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.junit.Test;

import java.io.*;
import java.util.Properties;

public class CodeGenerator {
//代码生成路径
private static String mapperPath;
private static String servicePath;
private static String serviceImplPath;
private static String controllerPath;
private static String queryPath;
private static String jspPath;
private static String jsPath;

static{
    //加载路径
    Properties properties = new Properties();
    try {
        properties.load(new InputStreamReader(CodeGenerator.class.getClassLoader().getResourceAsStream("generator.properties"),"utf-8"));
        mapperPath = properties.getProperty("gen.mapper.path");
        servicePath = properties.getProperty("gen.service.path");
        serviceImplPath = servicePath+"\\impl";
        controllerPath = properties.getProperty("gen.controller.path");
        queryPath = properties.getProperty("gen.query.path");
        jspPath = properties.getProperty("gen.jsp.path")+"\\domain";
        jsPath = properties.getProperty("gen.js.path");
    } catch (IOException e) {
        e.printStackTrace();
    }
}


//代码生成的先后顺序
private static final String[] paths = {controllerPath,servicePath,
        serviceImplPath,mapperPath,queryPath,jspPath,jsPath};
//模板先后顺序
private static final String[] templates = {"DomainController.java.vm",
        "IDomainService.java.vm","DomainServiceImpl.java.vm",
        "DomainMapper.java.vm","DomainQuery.java.vm","index.jsp.vm",
        "domain.js.vm"};

//要生成的那些实体类的相关代码
private static final String[] domains = {"Menu"};

//是否覆盖
private static final boolean FLAG = true;

@Test
public void test() throws Exception{

    //模板上下文
    VelocityContext context = new VelocityContext();
    //遍历所有的domain
    for (String domain : domains) {
        //拿到domain类名的大小写
        String DomainName = domain;
        String domainName = domain.substring(0,1).toLowerCase()+
                domain.substring(1);
        //上下文中设置替换内容
        context.put("Domain",DomainName);
        context.put("domain",domainName);
        //遍历路径,拿到模板生成目标文件
        for (int i=0;i<paths.length;i++) {

            //初始化参数
            Properties properties=new Properties();
            //设置velocity资源加载方式为class
            properties.setProperty("resource.loader", "class");
            //设置velocity资源加载方式为file时的处理类
            properties.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
            //实例化一个VelocityEngine对象
            VelocityEngine velocityEngine=new VelocityEngine(properties);

            String templateName = templates[i];
            //生成代码
            //生成的文件名
            String fileName = templateName.substring(0, templateName.lastIndexOf(".vm"));
            String filePath = paths[i]+"\\"+fileName;
            filePath = filePath.replaceAll("domain", domainName).
                    replaceAll("Domain", DomainName);
            File file = new File(filePath);

            System.out.println(filePath);

            //判断是否覆盖存在的文件
            if(file.exists()&&!FLAG){
                continue;
            }

            //获取父目录
            File parentFile = file.getParentFile();
            if(!parentFile.exists()){
                parentFile.mkdirs();
            }
            Writer writer = new FileWriter(file);
            //拿到模板,设置编码
            velocityEngine.mergeTemplate("template/"+templateName,"utf-8",context,writer);
            writer.close();

        }

    }

}

}
3.编写vm文件

package cn.itsource.crm.service.impl;
import cn.itsource.basic.mapper.BaseMapper;
import cn.itsource.basic.service.impl.BaseServiceImpl;
import cn.itsource.crm.domain.${Domain};
import cn.itsource.crm.mapper.${Domain}Mapper;
import cn.itsource.crm.service.I${Domain}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ${Domain}ServiceImpl extends BaseServiceImpl<${Domain}> implements I${Domain}Service {

    @Autowired
    private ${Domain}Mapper ${domain}Mapper;


    @Override
    public BaseMapper<${Domain}> getMapper() {
        return this.${domain}Mapper;
    } 
}

百度地图:怎么用的?

去百度地图的开发平台找到web开发JavaScript API
申请百度账号和ak


    <!DOCTYPE html>  
<html>
<head>  
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>Hello, World</title>  
<style type="text/css">  
html{height:100%}  
body{height:100%;margin:0px;padding:0px}  
#container{height:100%}  
</style>  
<!--引入api文件-->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥">
//v2.0版本的引用方式:src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥"
</script>
</head>  
 
<body>  
<div id="container"></div> 
<script type="text/javascript"> 
var map = new BMap.Map("container");
// 创建地图实例  
var point = new BMap.Point(116.404, 39.915);
// 创建点坐标  
map.centerAndZoom(point, 15);
// 初始化地图,设置中心点坐标和地图级别  
</script>  
</body>  
</html>

Lucene:是什么?怎么用?在你的项目中的是怎么用的(技术在项目中的使用场景,哪一个业务用了lucene?)

lucene是一个开放源代码的全文检索引擎工具包,但它不是一个完整的全文检索引擎,而是一个全文检索引擎的架构,提供了完整的查询引擎和索引引擎,部分文本分析引擎(英文与德文两种西方语言)。
在客户关系管理系统中,客户量会随着公司发展越来越多,一般的sql查询就会很慢。这时候我们就需要提高系统查询效率。lucene全文检索自动分词,创建检索后,用户只需要在查询条件中输入用户的相关信息就能迅速的查询到对应的数据集合。lucene会在服务器缓存数据,而不用去数据库查询。

第三方登录:什么是第三方登录,你用了哪一个的第三方登录?使用流程是什么?

第三方就是介于第一方和第二方具有权威的机构或组织。第三方登陆就是允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和密码提供给第三方应用。
微信登陆
1.进入微信开发平台开发模式,填写oauth2的回调地址,地址填写你项目的域名就可以了

     //在url中填写appid与你项目中方法中的oauth的地址
<a href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://www.xxxxxx.com/action/function/oauth2&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect">授权</a>

2.后台调用调用微信接口的SDK2.

 include('class_weixin_adv.php');

3.填入微信官方给的的appid与secret

  $weixin=new class_weixin_adv("appid", "secret");

4.继续调用SDK方法,获取到用户信息.此时$row已经获得用户信息了

  $row=$weixin->get_user_info($res['openid']);

Shiro:是什么?怎么用的?多realm怎么用的?

shiro 是一个强大且易用的Java安全框架,执行身份验证、授权、密码和会话管理。
srping集成shiro
 ···
<!--web.xml中spring-->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      classpath*:application-service.xml
      classpath*:application-shiro.xml
    </param-value>
  </context-param>
  ···
  <!--shiro的filter-->
  <filter>
    <filter-name>shiroFilter</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <init-param>
      <param-name>targetFilterLifecycle</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>

  <filter-mapping>
    <filter-name>shiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  ···
<!--shiro 的配置文件-->
<?xml version="1.0" encoding="UTF-8"?>

<!--Shiro的核心对象-->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
    <property name="authenticator">
        <bean class="cn.itsource.crm.shiro.authenticator.CRMAuthenticator">
            <property name="realms">
                <list>
                    <ref bean="employeeRealm"/>
                    <ref bean="wechatRealm"/>
                </list>
            </property>
        </bean>
    </property>
</bean>

<bean id="employeeRealm" class="cn.itsource.crm.shiro.realm.EmployeeRealm">
    <!--普通登录配置比较器-->
    <property name="credentialsMatcher">
        <bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
            <property name="hashAlgorithmName" value="MD5"/>
            <property name="hashIterations" value="50"/>
        </bean>
    </property>
</bean>

<bean id="wechatRealm" class="cn.itsource.crm.shiro.realm.WechatRealm"></bean>

<!--shiro的过滤器配置-->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
    <property name="securityManager" ref="securityManager"/>
    <!--当访问需要认证才能访问的页面时,如果没有认证,则跳转到这个页面-->
    <property name="loginUrl" value="/login"/>
    <!--登录成功后的页面-->
    <property name="successUrl" value="/main"/>
    <!--当访问需要授权才能访问的页面时,如果没有权限,则跳转到这个页面-->
    <property name="unauthorizedUrl" value="/unauthorized.jsp"/>
    <property name="filterChainDefinitionMap" ref="filterChainDefinitionMap"/>
</bean>

<bean id="FilterChainDefinitionMapFactory" class="cn.itsource.crm.shiro.factory.FilterChainDefinitionMapFactory"/>
<bean id="filterChainDefinitionMap" factory-bean="FilterChainDefinitionMapFactory"
      factory-method="getFilterChainDefinitionMap"/>

</beans>

多ralem是应用在当前系统有不同的认证授权规则时使用到的

根据用户从前端登陆是加入的识别参数,根据这个识别参数判断该使用哪一种认证规则
项目是用的spring springMVC myBatis框架,前段没用框架,只写了简单的页面效果,做增删查改 这是我系统学习所得,希望能对你有所帮助 项目部署: 1;导包,就是web-inf下lib,让后把这些选中,单击右键build path -->add library 2;web.xml配置文件,这里几乎不需要改,以后要用只需要复制就行 3;具体框架配置文件,都集中在了sourceConfig文件夹下,这个自己琢磨,以后再用这个框架也是几乎不需要改的,之所以说几乎,是因为只需要改包名就可以了 4;写bean,写dao,写service,写controller,这是重点 5;bean下写要操作的数据表,记住这个类药与数据库中的表一致,最好一模一样,避免麻烦 6;dao下写数据库操作内容,那下面有两个文件名一样的,一个是java文件,一个是xml文件,java文件是定义方法名,xml文件是让你写具体的数据操作方法的,格式就是这样,你看看就能懂,你只需要这样写,这个框架就可以识别,吧你在xml中写的数据库操作方法匹配到java文件中的方法,这是mybatis做的事 7;service包中放你的业务逻辑层,具体来说就是,dao中只放数据操作,service引用数据操作,还可以有其他操作 8;controller类的格式你要用心点了,这个是控制器,控制请求的跳转,他servlet的功能类似, 功能引导: 为了让你更方便了解这个项目,说一下流程 1.把项目部署到tomcat,启动服务, 2.在浏览器中输入http://localhost:8080/AscentSys/user/in.do 3.这个命令的意思是,访问这个项目地址user/in.do,然后这个请求就会发送到controller中,在controller中首先匹配到user,在匹配到in.do就调到具体的方法中去处理这个情求了,这里会跳转到users文件夹下的login.jsp页面中,解释一下,在spring-servlet.xml配置文件中有一句路径解析的,“前缀后缀”那个bean,意思是在返回的东西加前缀后缀,这里写的是啥你琢磨琢磨可以明白的 4.在login.jsp页面中,有个提交地址,是login.do,按上面说的,在controller中首先匹配到user,在匹配到login.do就调到具体的方法中去处理这个情求了,后面的流程我就不说了,自己看 5。再说一点,return的好多字符串,有的是redirect:/user/userlist.do这样的格式,意思是转发,就是转到另一个请求中去,同理,具体意思是,在controller中首先匹配到user,在匹配到userlist.do就调到下面的方法中去处理这个情求了, 6,关于传参数的问题,在表单中写的属性,在controller自动接收,也可以接受user对象,如果是对象,那个表单的格式你要看仔细了一般表单的不同之处。琢磨琢磨你会明白的, 希望能对你有所帮助
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值