ssh框架整合开发杂记

ssh框架整合开发杂记
Struts2的下载地址:
http://struts.apache.org/download.cgi
目前建议下载版本:2.2.1GA版

Hibernate下载地址:
http://www.hibernate.org/downloads
目前建议下载版本:3.6.0 Final版

Spring的下载地址:
http://www.springsource.org/download
目前建议下载版本:稳定版3.0.5

 
 
 
2013-1-15  
1、struts2  top关键字理解。 
1).top 指代当前迭代元素,可以为对象;
2).这里的top可用[0].top替代,但不能使用[0];[0]代表整个栈对象。如果单纯调用[0]将会调用其 toString()方法输出对象信息;



2、删除信息时错误日志:
java.lang.IllegalArgumentException: Removing a detached instance

 Detached - a detached instance is an object that has been persistent, but its Session has been closed. The reference to the

      object is still valid, of course, and the detached instance might even be modified in this state. A detached instance can be

      reattached to a new Session at a later point in time, making it (and all the modifications) persistent again

      现在应该明白了吧,在删除之前把这个Detached instance绑定到当前的Sesssion,在用当前Sesssion删除此instance。修改后的代码如


解决办法:
public void delete(SASVo  vo) {
               entityManager.remove( entityManager.merge(vo));
        }

你可能感兴趣的:(ssh框架整合开发杂记)