第二个项目——教师职称

首先,解决导入项目没得对应java EE 5 libery问题:

Build Path=>configure Build Path...=>Libraries=>
Add Library...=>选择MyEclipse Libraries=>勾选上 Java EE 5 Libraries

值得注意的小地方(细节):

ctrl+1:强转快捷键
String hql = "from Student student where student.id ="+id+"";
Student 是对应的bean实体(实体大写则这个也大写);student.id是实体对应的属性,
如果是int类型,则为"+id+",如果是字符串就用'"+username+"';

错误1:Error creating bean with name 'managerAction' defined in
class path resource [conf/app-action.xml]: Error setting property values;
nested exception is org.springframework.beans.NotWritablePropertyException:
Invalid property 'managerService' of bean class [cn.edu.abtc.action.sys.ManagerAction]:
Bean property 'managerService' is not writable or has an invalid setter method.
Does the parameter type of the setter match the return type of the getter?
--解决:action里面有service属性并且get和set,service里面有dao和dao的get和set

错误2:mapping,不存在entity,就是hibernate映像文件路径不匹配

错误3:No result defined for action cn.edu.abtc.action.login.LoginAction
       and result success
--解决:对应Action里面的对应方法没有返回值,匹配不到structs


错误4:Error setting expression 'lastdate' with value '[Ljava.lang.String;@159abf4'
java.lang.String cannot be cast to java.util.Date
--解决:类型转换出错,'lastdate' 是Timestamp型,而页面是String型,所以我把'lastdate'
设成Stirng型即可

 

转载于:https://my.oschina.net/u/3527528/blog/918087

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值