随笔分类 -  SpringMvc

SpringMvc的JSON数据交互
摘要:为什么要进行json数据交互 json数据交互在接口调用中、html页面中较常用,json格式比较简单,解析还比较方便。 比如webservice接口,传输json数据。 1、如果客户端传输的是json串的话 那么会使用一个注解 @RequestBody 来将json串转成java对象 @Respo 阅读全文
posted @ 2016-10-22 17:51 Lightt 阅读(467) 评论(0) 推荐(0)
SpringMvc+Mybatis开发需要的jar包
摘要:SpringMvc+Mybatis开发需要的jar包 阅读全文
posted @ 2016-10-22 17:29 Lightt 阅读(263) 评论(0) 推荐(0)
nested exception is java.lang.NoClassDefFoundError: org/hibernate/validator/resourceloading/ResourceBundleLocator
摘要:原来的hibernate-validator-5.3.0.Final.jar里没有这个接口,换成 hibernate-validator-4.1.0.Final.jar 就好了 阅读全文
posted @ 2016-10-21 01:03 Lightt 阅读(999) 评论(0) 推荐(0)
SpringMvc参数绑定出现乱码解决方法
摘要:在SpringMvc参数绑定过程中出现乱码的解决方法 1、post参数乱码的解决方法 在web.xml中添加过滤器 2、处理get参数的乱码有两种 一种是在Tomcat的配置文件中 修改 二是对参数进行重新编码 String userName=new String(request.getParamt 阅读全文
posted @ 2016-10-18 23:03 Lightt 阅读(256) 评论(0) 推荐(0)
SpringMvc参数绑定
摘要:在SpringMvc中页面传递的数据是通过Controller中方法的形参接收的 而不是在方法的成员变量来接收 客户端请求发送key/value 处理器适配器调用SpringMvc提供参数绑定组件将key/value转成Controller方法的形参 参数绑定组件在早期的版本是PropertyEdi 阅读全文
posted @ 2016-10-18 22:05 Lightt 阅读(195) 评论(0) 推荐(0)
Controller的返回值
摘要:1、返回String类型 表示返回逻辑视图名 真正视图名(jsp路径)=前缀+逻辑视图名+后缀 2、redirect 重定向 redirect 重定向的特点:浏览器地址栏中的url会变化 。修改提交的request数据无法传到重定向的地址 因为重定向后重新request(request无法共享) 3 阅读全文
posted @ 2016-10-15 00:15 Lightt 阅读(269) 评论(0) 推荐(0)
c3p0连接池在spring中的配置
摘要: 阅读全文
posted @ 2016-09-23 23:40 Lightt 阅读(606) 评论(1) 推荐(1)
Spring数据库连接池 c3p0、dbcp、spring-jdbc
摘要:在用dbcp的时候 后面加上 destroy-method="close" 销毁的方法没事 但是用 spring的jdbc就会报错 提示找不到close这个方法 这是为什么? DBCP DBCP(DataBase connection pool),数据库连接池。是 apache 上的一个 java 阅读全文
posted @ 2016-09-23 23:24 Lightt 阅读(311) 评论(0) 推荐(0)
ERROR [localhost-startStop-1] - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/ap
摘要:刚学java 不小心 加载springmvc配置文件的时候 在web.xml文件下 <context-param> <param-name>contextLoaderListener</param-name> <param-value>/WEB-INF/classes/spring/applicat 阅读全文
posted @ 2016-09-23 21:29 Lightt 阅读(16130) 评论(0) 推荐(0)
严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name
摘要:这个错误是因为service无法自动注入 主要是Could not autowire field: private com.jkw100.ssm.service.impl.PatientServiceImpl @Autowired private PatientServiceImpl patient 阅读全文
posted @ 2016-09-23 15:10 Lightt 阅读(6900) 评论(0) 推荐(1)
SpringMvc.xml
摘要:--> --> --> 阅读全文
posted @ 2016-09-23 00:39 Lightt 阅读(182) 评论(0) 推荐(0)
SpringMvc和Mybatis整合
摘要: 阅读全文
posted @ 2016-09-21 23:34 Lightt 阅读(166) 评论(0) 推荐(0)
什么是SpringMvc
摘要:1、什么是SpringMvc? SpringMvc是spring的一个模块 基于MVC的一个框架 无需中间整合层来整合 什么是MVC ?mvc在b/s下的应用: 首先请求发送request请求到C(control 接收用户请求响应用户) 然后控制器到M模型(pojo、action、service、d 阅读全文
posted @ 2016-09-20 20:53 Lightt 阅读(41598) 评论(0) 推荐(1)