1、idea使用c3p0找不到ComboPooledDataSource类的情况,解决办法:在WEB-INF目录下创建lib并把c3p0包复制到里面即可。
2、连接数据库时提示time错误,在DBUtils类中url属性后添加?characterEncoding=utf8&serverTimezone=UTC 本条适用mysql。
3、tomcat适用要创建CATALINA_HOME环境变量,值为tomcat所在目录。
4、关于乱码过滤器主要用
request.setCharacterEncoding(encode);
response.setContentType("text/html;charset=UTF-8");
两个方法。
5,、关于未登录访问受限资源、应设立SessionFilter,在用户登录系统时,request.getsession().setAttribute(key,value).在过滤器中request.getSession().getAttribute(key);如果key是null,则request.getRequestDispatcher("login.jsp").forward(request.response);为session设立超时时间,在xml中配置<session-config><session-timeout>30</session-timeout></session-config>意为session30分钟超时。
7、redirect和forword的区别
redirect是浏览器a向b请求,b转发给c,forword是浏览器a向b请求,b不行,让a自己去向c请求
8、