SSH框架发展搭建问题整理

1.com.mysql.jdbc.Driver
2.DriverManager.getConnection("mysql:jdbc://localhost/test","root","root");
3.preparedStatement
4.rs.getInt(1) 查*时rs不为空
5.conn.close()
6.response.sendRedirect("success.jsp");return;

7.jdbc是一个标准,根据不同的数据库有不同的包处理,底层均调用java自带的sql包。

8.java.lang.ClassNotFoundException: org.hibernate.Session 原因是找不到hibernate.jar,我是创建了User Liberary。需要把包放在lib下。

9.org.apache.jasper.JasperException: org.hibernate.hql.ast.QuerySyntaxException: user is not mapped  

因为hql语句中,表名应该与类名一致。目前是hql和model名称均与表名一致才可以。与表名不一致的情况如何处理还不知道。

10.hibernate @Table The type java.lang.CharSequence cannot be resolved

The type java.util.Map$Entry cannot be resolved. 

此异常是由于jre的版本不匹配导致的。

在MyEclipse中的配置方式为:右击项目->configuration buildPath->选择jre8->remove->add library->JRE SystemLibrary->jre6。

11.Java.lang.NullPointerException
 at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)

将struts.xml中的devMode去掉。

12.cvc-complex-type.2.3:Element \'filter-mapping\' cannot have character [children],because the type\'s content type is element-onl

因为是从struts文档中粘贴的,网页上粘贴多了其他如空格等内容,导致报错。自己重新手打解决。

13.struts2.5版本,只支持个别词通配符,需要在package中加入

<global-allowed-methods>regex:.*</global-allowed-methods>

posted on 2017-04-24 12:37  泽口靖子  阅读(181)  评论(0)    收藏  举报

导航