采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
新增店铺的时候,通过传递图片流,数据流,以及验证码全部封装到一个对象formData里进行传输,后台通过request.getParamter(key)获取不到,有遇到过该问题的,还望告知,谢谢
看看chrome开发者里面,同学传入的请求contenttype是多少?
同时,同学可以把maven repository下面的jar全部清空,之后重新update maven project,rebuild project,再clean tomcat试试
同时请检查import的request是否是
import javax.servlet.http.HttpServletRequest;
这些都要排查哈
都是啊,但是就是接受不到参数
同学你把项目发送到course_o2o@163.com,我最近比较忙,这几天有空就帮同学看看,同学期间也可以按照视频的重新弄一遍,肯定还是哪里配置有问题。
同学好,可能是由于spring-web.xml配置有问题导致,可以直接复制粘贴我的,之后没问题再看看差别在哪里
spring-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注解模式 --> <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"></property> <!-- 1024 * 1024 * 20 = 20M --> <property name="maxUploadSize" value="20971520"></property> <property name="maxInMemorySize" value="20971520"></property> </bean> <!-- 4.扫描web相关的bean --> <context:component-scan base-package="com.imooc.o2o.web" /> </beans>
如果还是不行,建议先把shopImage注释掉,先不传入后台,看看能否获取到shopStr这个值。
如果还是不行,请检查import的request是否是
总之,还需要一步步排查
如果还是不行,看看chrome开发者里面,同学传入的请求contenttype是多少
貌似还是不行,单传一个参数,也是接收不到的
发现用append方法并没有将属性值赋值上去
登录后可查看更多问答,登录/注册
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
2.3k 47
2.4k 41
3.2k 40
2.3k 39
2.1k 37
购课补贴联系客服咨询优惠详情
慕课网APP您的移动学习伙伴
扫描二维码关注慕课网微信公众号