今天完成的事情:
1.记录一波在eclipse建maven项目的过程出的错
1 index.jsp报错
buildpath -- configure。。 ---add Library --server
2.看了servlet的基础知识
servletConfig主要用于某个初始化参数、ervletContext是应用的上下文,可以初始化所有servlet的初始化参数。
3.关于task4的t11页面比想象中的要难得多,本来以为今天会完成,但是今天只设计了几张表,还有可能不对。
明天计划的事情:
1.完成task4的t11由静态页面转为动态页面
遇到的问题:
1.mybatis的xxxMapper.xml文件中配置<resultMap>里有<collection>标签,<collection>里面有property属性,具体是指什么不太清楚。
收获:
1.关于绝对路径
String basePath = request.getScheme()+"://"+request.getServerName()+":"+requst.getServerPort()+path+"/"
1、request.getScheme() 返回协议的名称 http,和后面的"://" 拼起来就成了 http://
2、request.getServerName() 这是获取你的服务器的名称,如果你的应用部署在本机那么其就返回localhost或者127.0.0.1 ,这两个是等价的 3、request.getServerPort() 是你应用使用的端口,比如8080或者80 等等
上面3点的结果拼起来就构成了你应用的根路径或者说是根url
2. 关于删除MySQL表中的外键约束
mysql> ALTER TABLE articles DROP FOREIGN KEY fk_member;
其中的fk——member 是 可以用show create table table_name;查出来
4. web.xml 文件头信息
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
评论