发表于: 2017-04-08 21:12:42
2 1245
今天完成的任务:
对jsp页面做了改变,显示出了新的内容,下一步添加连接,使页面上的内容可以连接到数据库。网页页面和后台数据库的交互,这一块的内容终于有了具体的认识。晚上复习了mybatis,对它的映射机制又有了新的认识。
解决了一个springMVC中jsp页面中文显示乱码的问题,
1.springmvc project报错,
Referenced file contains errors (http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd). For more information, right click on the message in the Problems View and select
"Show Details..."
The errors below were detected when validating the file "spring-mvc-3.2.xsd" via the file "spring-mvc.xml". In most cases these errors can be detected by validating "spring-mvc-3.2.xsd" directly. However it is possible that errors will only occur when spring-mvc-3.2.xsd is validated in the context of spring-mvc.xml
解决:Windows菜单选项下,选择解码方式从GBK变成UTF-8
2.springMVC project 中jsp显示页面乱码,
解决:
在index.jsp页面文件头行加入语句<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
明天的计划:
在jsp页面做出链接后台数据库的链接。复习mybatis和spring。
遇到的问题:
终于碰到传说中的乱码了。虽然有点棘手,但没想象的那么难,反而mybatis中的这一句理解起来很抽象,老韩讲了好一会,才算有点模糊的认识,StudentMapper_11.class长的很吓人,其实就是一个参数。但具体的意思还需要在它传递到的最终解决方法中找。
StudentMapper_11 mapper = sqlSession.getMapper(StudentMapper_11.class);
收获:
Java深不可测,语法规范其实只是最简单的约束,使用起来千变万化。加油!
评论