
struts2、hibernate
文章平均质量分 52
lhq_org
这个作者很懒,什么都没留下…
展开
-
hibernate HQL语句不执行,而且不报错不异常
问题:在DAOImpl里写一个delete方法,执行了没有对数据库数据处理解决:写hibernate HQL语句,忘记了提交commit。改前代码try{ Person person = (Person)session.get(Person.class, id); session.delete(person); } catch(Excep原创 2012-05-01 18:58:48 · 1171 阅读 · 0 评论 -
HTTP Status 500 - exception java.lang.NoSuchMethodException:
问题:java.lang.NoSuchMethodException: com.lnzkx.action.PersonAction.getSinglePerson()java.lang.NoSuchMethodException: 这个异常往往都是指,调用了不存在的方法解决:struts.xml配置method里方法名一定要和action的方法名一致 getSinglePe原创 2012-05-01 19:54:55 · 704 阅读 · 0 评论 -
Exception starting filter struts2
问题:Exception starting filter struts2java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils 解决:导入一个jar包commons-lang-2.5.jar 总结:出现Exception starting filter struts2大部分都是jar原创 2012-05-01 12:15:45 · 238 阅读 · 0 评论 -
黄代号:The serializable class *** does not declare a static final serialVersionUID field of type
serialVersionUID作用: 序列化时为了保持版本的兼容性,即在版本升级时反序列化仍保持对象的唯一性。有两种生成方式: 一个是默认的1L,比如:private static final long serialVersionUID = 1L; 一个是根据类名、接口名、成员方法及属性等来生成一个64位的哈希字段,比如: p转载 2012-05-01 08:37:13 · 3362 阅读 · 0 评论 -
HTTP Status 404 - No result defined for action com.lnzkx.action.PeronAction and result success
问题:HTTP Status 404 - No result defined for action com.lnzkx.action.PeronAction and result successtype Status reportmessage No result defined for action com.lnzkx.action.PeronAction and result su原创 2012-05-01 16:42:37 · 524 阅读 · 0 评论 -
org.hibernate.MappingNotFoundException: resource: xxx.hbm.xml not found
问题:信息: HTMLManager: list: Listing contexts for virtual host 'localhost'org.hibernate.MappingNotFoundException: resource: Person.hbm.xml not found解决:hibernate.cfg.xml里对应xxx.hbm.xml名字总结:xml文原创 2012-05-01 13:28:11 · 1388 阅读 · 0 评论 -
org.hibernate.PropertyNotFoundException Could not find a getter for id in class
问题:org.hibernate.PropertyNotFoundException Could not find a getter for id in class com.lnzkx.model.ChildUser解决:在ChildUser.hbm.xml里主键设置错误改前代码原创 2012-05-03 10:32:17 · 923 阅读 · 0 评论 -
struts2+JQuery+json实现的交互
Struts2+JQuery+JSON实现异步交互,包括从后台获得单个值、对象、List和Map数据并从前台的表达中获取值把值进行序列化通过JQuery的$.ajax({})传到后台和后台的对象进行绑定。 第一步:在MyEclipse中创建JavaWeb工厂并把Struts2 和 json的jar包添加到工程中添加完成后的工程图是: 第二步:创建后台: 1. Use转载 2012-05-03 21:55:32 · 392 阅读 · 0 评论