zoukankan      html  css  js  c++  java
  • 校园商铺-4店铺注册功能模块-13前后端联调验证整体模块功能

    1.前端发起请求


    填入信息,31行添加断点,按F10

    2.服务端查看响应

    后端添加断点,F6执行,F5进入方法

    预期:店铺添加成功

    3.问题

    3.1服务端没有获取到传递的信息。

    如填入正确的验证码,服务端返回验证码不正确。断点查看结果为null。

    方法:
    1.导入依赖

            <dependency>
                <groupId>commons-fileupload</groupId>
                <artifactId>commons-fileupload</artifactId>
                <version>1.3.2</version>
            </dependency>
    

    2.sprint-web.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:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
        <!-- 配置SpringMVC -->
        <!-- 1.开启SpringMVC注解模式 自动识别controller类,不需要xml中做bean的配置-->
        <mvc:annotation-driven />
        <!-- 2.静态资源默认servlet配置
        	(1)加入对静态资源的处理:js,gif,png
        	(2)允许使用"/"做整体映射 -->
        <mvc:resources mapping="/resources/**" location="/resources/" />
        <mvc:default-servlet-handler />
        <!-- 3.定义视图解析器 -->
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
        	<property name="prefix" value="/WEB-INF/html/"></property>
        	<property name="suffix" value=".html"></property>
        </bean>
        <!-- 添加文件上传解析器 -->
        <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" >
        	<property name="defaultEncoding" value="utf-8" />
        	<!-- 1024*1024*20 -->
        	<property name="maxUploadSize" value="20971520" />
        	<property name="maxInMemorySize" value="20971520" />
        </bean>
        <!-- 4.扫描web相关的bean -->
        <context:component-scan base-package="com.csj2018.o2o.web" />
    </beans>
    
  • 相关阅读:
    【转】Android开发实践:自定义带消息循环(Looper)的工作线程
    【转】 解决IllegalStateException: Can not perform this action after onSaveInstanceState
    【转】Fresco之强大之余的痛楚
    【转】Android 防破解技术简介
    改进版本号的精确数据权限定义和实现
    明天是我的生日,写给24岁的自己
    javascrip cookie
    Servlet -- 跳转到页面后的绝对路径与相对路径的问题
    JAVA訪问URL
    跨浏览器resize事件分析
  • 原文地址:https://www.cnblogs.com/csj2018/p/12195525.html
Copyright © 2011-2022 走看看