发表于: 2016-10-09 10:32:35

2 2276


一、今天完成

1.task4各种问题,不断调BUGing。


二、明天计划

1.完成task4

1)目前已经用最简单的方式实现了apache tiles的页面复用,先把T10、T11全部用这个实现了。

2)CSS效果没有加载出来,要实现。

3)日期的格式转化问题,做出来。

4)找古尘师姐申请一个云服务器,完成移植。

2.串联task1-4的知识点,晚上向小组其他成员进行汇报。


三、遇到问题
1.主机上测试需连接ubuntu上的mysql,页面500错误,运行时log4j错误日志:
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection;
自己排除,可能是ubuntu上mysql没有给远程用户设置访问权限所致,处理步骤如下:
1)进入mysql输入指令
grant all privileges on *.* to admin@'%' identified by 'admin';
flush privileges; 
其中%表示任意远程主机
2)修改mysql配置文件
/etc/mysql/mysql.conf.d/mysqld.cnf 将其中的 bind-address = 127.0.0.1 以#注释掉
3)重启mysql服务
sudo service mysql restart
2.新工程的log4j启动后未正常记录日志,添加下列依赖后正常
<!-- Logging -->
<dependency>
 <groupId>org.slf4j</groupId>
 <artifactId>slf4j-api</artifactId>
 <version>1.6.6</version>
</dependency>
<dependency>
 <groupId>org.slf4j</groupId>
 <artifactId>jcl-over-slf4j</artifactId>
 <version>1.6.6</version>
 <scope>runtime</scope>
</dependency>
<dependency>
 <groupId>org.slf4j</groupId>
 <artifactId>slf4j-log4j12</artifactId>
 <version>1.6.6</version>
 <scope>runtime</scope>
</dependency>

3.<img>图片无法正常显示,啃了半天!最后发现是web.xml中servlet拦截的是“/”,静态资源请求也给拦截了,目前静态图片可以显示,但GIF的仍不能显示!


四、收获

1.收获各种bug的心理打击,233333

2.springmvc静态资源不拦截

<!--不拦截静态资源 方法1-->
<mvc:resources location="/" mapping="/**/*.html"/>
<mvc:resources location="/" mapping="/**/*.js"/>
<mvc:resources location="/" mapping="/**/*.css"/>
<mvc:resources location="/" mapping="/**/*.png"/>
<mvc:resources location="/" mapping="/**/*.gif"/>
<mvc:resources location="/" mapping="/**/*.jpg"/>
<!--不拦截静态资源 方法2-->
<mvc:default-servlet-handler />

3.web.xml中

如果使用/*,那么请求时可以通过DispatcherServlet转发到相应的Action或者Controller中的,但是返回的内容,如返回的jsp还会再次被拦截,这样导致404错误,即访问不到jsp。


返回列表 返回列表
评论

    分享到