昨天晚上我给他讲了英文笑话,虽然他指出了很多错误,但那是个好的开始。
A redneck bought a tickect and won the lottery.
He went to claim it .He said:"I want $20 million right now"
who verified his tickect number replied to him :"No,sir.It doesn't work this way.we give you $1 million today,you will get the rest spread on for the next 19 years."
The redneck said:"I want all my money.I won it,and i want it"
The man had to explained to him patiently:"you would get $1 million,and the rest during the next 19 years."
The redneck ,furious with the man ,screamed out:"I want all my money.If you don't give me all my money ,i want my dollar back!"
注意读音:money、million、battle zone。
我的叔叔silas H.E.Bates
我的叔叔silas 活了九十五岁,有充足的时间去尝试很多事情.他一度做过掘墓人.
In a life of 95 years ,my uncle found time to try most things, there was a time he become a gravedigger.
posted @
2006-05-09 14:34 aimy 阅读(109) |
评论 (0) |
编辑 收藏
1、get是从服务器上取得数据,post是向服务器上传送数据。
2、get是将参数数据队列(表单)加到提交表单的action所指定的url中,值和表单的各个字段是相互对应的,Get将表单中数据的按照variable=value的形式,添加到action所指向的URL后面,并且两者使用“?”连接,而各个变量之间使用“&”连接,在url中是可以看见的,
post是将表单各个字段放在http header内一起传送到action中的URL中,
3、get,服务器通过request.getQuery()获得对应的值;对于post,服务器通过request.getForm()表单的值。
4、get,传送的数据小,post,传送的数据大,上传文件一般用post
特别注意:
<form action="/GraAppInfo/GraAppInfo.do?method=UpList" method="post">
<select name="srchType">
<option value="0">名字</option>
<option value="1">用人单位</option>
</select>
<input height="18" name="srchEdit" type="text" align="right">
<input type="submit" value="查询">
显示的URL:http://localhost:8080/GraAppInfo/GraAppInfo.do?method=UpList
<form action="/GraAppInfo/GraAppInfo.do?method=UpList" method="get">
显示的URL:http://localhost:8080/GraAppInfo/GraAppInfo.do?srchType=0&srchEdit=da
可见post 会覆盖action中的参数,
5、中文用post传递不会出现乱码,用get传递会出现乱码
所以传到action后要通过
String srchEdit = new String(graForm.getSrchEdit().getBytes("iso8859-1"), "gb2312");
处理。
二、传到页面的值乱码
posted @
2006-05-08 09:50 aimy 阅读(216) |
评论 (0) |
编辑 收藏
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="cancel*">PROPAGATION_REQUIRED</prop>
<prop key="create*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
</props>
如果service层没有用这些字母开头命名,spring自动将它处理为默认的访问模式--PROPAGATION_REQUIRED,readOnly
如果在action直接调用dao层也不行,比如service.getbaseDAO.update(object)也会出现类似的错误,因为事务被拦截了,所以dao层的方法最好用protect,这样只有同一个包里的类可以调用它的方法。
posted @
2006-04-30 14:37 aimy 阅读(84) |
评论 (0) |
编辑 收藏
MENUID UPMENUID MENUNAME MENUURL MENUSEQ LAYERLEVEL RIGHTCODE ISSHOW TABLETYPE STARTSTATE
1083 1001 毕业生招聘 # 1 1 1083 1
1084 1083 毕业生申报 /GraAppInfo/GraAppInfo.do?method=graappinfolist 6 9 1084 1
menuid 该层菜单的id upmenuid 上一层菜单id menuname 菜单名字
menuurl 该层菜单的地址(首层菜单为#,没有地址)
menuseq 该层菜单在上一层菜单的顺序
layerlevel 如果是最后一层的菜单为9,其他为1
rigntcode关联到权限表=menuid
idshow 是否显示
权限表:
RIGHTID RIGHTCODE ROLETYPE ROLEID DEPTID USERID MENUID FUNNAME
1084 1084 2 2
0 0 1084 毕业生申报
rightid=menuid=rightcode,roletype,roleid
这是单位的菜单设置和权限设置(1000〈menuid〈2000)
2、人事单位内部的设置(4000〈munuid〈5000)
权限的设置通过页面来控制
posted @
2006-04-30 11:19 aimy 阅读(144) |
评论 (0) |
编辑 收藏
为了在每个dao和service 类都能用到log,在basedaoimpl和baseserviceimpl都实现方法:
public Log getLogger() {
if (log == null) {
log = LogFactory.getLog(this.getClass());
}
return log;
}
在类中就可以调用log
this.getLogger
2、<input type="text" name="password">
与form的属性对应,password是大小分别。
posted @
2006-04-25 18:07 aimy 阅读(126) |
评论 (0) |
编辑 收藏
public class EmployUnitBaseInfo
{
private long ID; //用人单位系统编号---逻辑主键
private String unitCode; //用人单位代号--业务主键
}
1、 使用逻辑主键,分页比较方便
2、 有可能unitcode会改变,用id可以保证当unitcode改变时,这个实体还存在
在页面上必须返回workpost + demandid,,
pojo 中的demand类如下:只有以下属性的setter和getter
private String usedNeedNum;
private int unitId;
private String demandInfo;
private long ID;
private String needNum;
private String position;
必须再添加一个属性demandInfo,
而在另一个毕业生申报中又要如图上操作,,如何在service层向页面层传递这些信息(测试程序员(剩2需求数))
public class DemandServiceImpl
extends BaseServiceImpl implements DemandService{
public List getDemandList(int unitId)
{
long demandId;
int needNum;
int usedNeedNum;
int lastNum;
String demandInfo;
TRealDemandDAOImpl dao = (TRealDemandDAOImpl) this.getBaseDAO();
List list = dao.getSpareDemandByUnitId(unitId);
Iterator it = list.iterator();
while(it.hasNext())
{
TRealDemand demand = (TRealDemand) it.next();
demandId = demand.getID();
needNum = Integer.parseInt(demand.getNeedNum());
usedNeedNum = Integer.parseInt(demand.getUsedNeedNum());
if(needNum>usedNeedNum)
{
lastNum = usedNeedNum-needNum;
demandInfo = demand.getPosition()+" 剩 " + lastNum +" 需求数 ";
}
}
return list;
}
}
在action层再通过以下代码向页面传递数据:
DemandService demandService = (DemandService) this.getBean("DemandService");
request.setAttribute("demandList",demandService.findDemandListByUnitId(unitInfo.getID()));
4、注意DemandServiceImpl 是实现类,DemandService 是interface
DemandService demandService = (DemandService) this.getBean("DemandService");
和DemandServiceImpl demandService = (DemandServiceImpl) this.getBean("DemandService");
虽然两个的操作一样,但是demandService是接口但可以执行相应的操作,起到黑箱子的作用。
5、记得在action中添加一个实体时,要通过idcard取得sex和birthday的属性加到内存中(表相对应的pojo)
posted @
2006-04-21 10:36 aimy 阅读(99) |
评论 (0) |
编辑 收藏
String mSqlStr = " SELECT ";
mSqlStr += " UnitName, ";
mSqlStr += " FSUName, FSUPostNumber, FSUAddress ";
mSqlStr += " FROM xmpi.v_UnitInfoAll ";
mSqlStr += " WHERE UnitCode = '" + s_sUserName + "'";
如果s_sUserName="hello",则" WHERE UnitCode = '" + s_sUserName + "'"就相当于" WHERE UnitCode = '" + "hello" + "'" , 最后等于" WHERE UnitCode = ' hello';
1、value="<logic:notEmpty name="IDCardNo"><bean:write name="IDCardNo"/></logic:notEmpty>"
如果直接用value="<%=IDCardNo%>",当IDCardNo为null时,页面会出错。而logic:notEmpty表示不为空时,才执行note中间的代码。
2、<logic:iterate id="nation" name="nationList" >
<option value="<bean:write name="nation" property="codeID"/>"><bean:write name="nation" property="codeName"/></option>
</logic:iterate>
表示一组循环,每次循环都从list nationlist(name="nationList")中取出一个个体nation(id="nation")
注意:当IDCardNo为string,只要指明name属性(name="IDCardNo"),当nation为对象,不仅要指明object名(name="nation" ),还要指明这个对象内的属性(property="codeID")
3、在serviceimpl层通过 PersonnelDAO dao = (PersonnelDAO)this.getBaseDAO()取得dao类操作,在action层PersonnelService service = (PersonnelService)this.getBean("personnelService")取得serviceimpl类,,同样在application中设置为什么方法不一样??
4、单个条件查询
string id;
string hql = new String(" from PersonnelBaseInfo where idCardNO=?");
Object[] object = new Object[] {id}
this.getHIbernateTemplate().find(hql,object);
多个条件查询
string id,name;
string hql = new String(" from PersonnelBaseInfo where id=?&&name=?");
Object[] object = new Object[] {id,name}
//object[0]=id;
//object[1]=name
this.getHIbernateTemplate().find(hql,object);
5、记得研究jslib.jsp中的getBaseCode??
6、不用身份证做TGraAppInfo主键的原因是有可能两家公司同时抱同一个人,,但审核只能通过一份。
7,pojo与actionform的不同:pojo中对应于数据库外键的属性,实体来表示;比如表user内有一个字段为studentid,则pojo--userinfo中有一个属性为student。
而对应于web页面有一个类为userform,有一个属性为long。
8。dto与pojo类的不同
dto是中间传递类,是用来封装参数的类,比如将查询条件太多,则封装成一个dto
9。import com.xindeco.business.IEmployUnitData;==相当于现在系统的service
import com.xindeco.business.employunitdata.EmployUnitAPI;相当于现在系统的serviceimpl
import com.xindeco.business.employunitdata.EmployUnitBaseInfoVO;//相当于现在系统的pojo
10 codeApi类
codeApi.findCodeInfoByCodeID(sexID).getCodeName()
根据codeid查找一行记录;
codeApi.findCodeList(BaseCodeConstants.CODETYPE_NATION)
根据codetypeid查找一串记录;
tcode的表结构为
CODEID CODETYPEID CODEVALU CODENAME ACTIVE
比如: 1 1 1 男 1
CODECOMPAREVALUE UPCODEID
1 0
tcodetype的表结构为:
CODETYPEID CODETYPENAME
1 性别
学制: CODETYPE_EDUSYSTME 培养方式:CODETYPE_UNITGRADE 五大生: CODETYPE_RECRUITTARGET
posted @
2006-04-19 16:56 aimy 阅读(166) |
评论 (0) |
编辑 收藏
<hibernate-mapping>
<class
name="org.hibernate.sample.TUser"
table="t_user"
dynamic-update="true"
dynamic-insert="true"
>
……
<set
name="addresses"
table="t_address"
lazy="false" \\延迟加载,当映射到对应的pojo时,没有加载到addresses对应的属性,通过Taddress.getAddress()取不到值,而且特别注意当session一关闭时,就取不到了
inverse="false" \\反转控制,当inverse="true"时,时通过被控方address.setUer()来维系他们之间的关系.
cascade="all"
sort="unsorted" \\是否排序
order-by="zipcode asc" \\以什么方式排序
>
<key
column="user_id"
>
</key> \\外键
<one-to-many
class="org.hibernate.sample.TAddress"
/>
</set>
……
</class>
posted @
2006-04-19 10:37 aimy 阅读(228) |
评论 (0) |
编辑 收藏
1.注意安装程序的时候要改变log文件的目录,在log4j.properties中log4j.appender.R.File=E:\\NewFroject\\JmrlProject\\06.NewSourceCode\\newJmrl\\webapp\\WEB-INF\\classes\\jmrl.log
2、开始一个新的项目,必须重新设置tomcat,否则tomcat可能老是启动原来的项目
3、开始一个新的webapp要把webapp-->properties--->build-->build app archive 设为never ,还有build app directory为never这样可以加快编译的过程.
posted @
2006-04-17 17:05 aimy 阅读(96) |
评论 (0) |
编辑 收藏
1、
org.springframework.orm.ObjectRetrievalFailureException: Object of class [com.xindeco.myregister.pojo.MyRegisterInfo] with identifier [14]: not found
MyRegisterInfo在数据库没有identifier [14]对象。
2、
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Repeated column in mapping for entity: com.xindeco.myregister.pojo.MyRegisterInfo column: password (should be mapped with insert="false" update="false")
出错原因:password 和repassword同时对应数据库表中的password一列,同时update和insert都设为true。
xml文件如下:
<property name="password"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="password"
length = "32"
/>
<property name="repassword"
type="java.lang.String"
update="false"
insert="false"
access="property"
column="password"
length = "32"
/>
解决的方法:
将repassword的insert和update设为false。
3、
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed;
nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for ID in class
错误原因:hibernate的映射文件中ID是大写的,而pojo的类中id是小写的
注意事项:每个pojo的类都要继承abstractEntity,其中abstractEntity类有个ID的属性要重写
public abstract class AbstractEntity
implements Entity, BaseDTO {
abstract public long getID();
abstract public void setID(long id);
public int hashCode() {
return (int)this.getID();
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof Entity) {
return this.getID() == ( (Entity) obj).getID();
}
return false;
}
}
4、
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
错误原因:
在application.xml文件中deleteRegister方法以delete开头,并没有被设定为可更改的,应如下设置:
<!--为事物创建代理类,并指定方法的事物类型-->
<bean id="baseTxProxy" lazy-init="true" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="cancel*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
加上一行
<prop key="delete*">PROPAGATION_REQUIRED</prop>
5、
ERROR org.apache.struts.util.RequestUtils - Error creating form bean of class com.xindeco.business.web.form.GraAppInfoForm
public class GraAppInfoForm
extends ActionForm 错误写成
public abstratic class GraAppInfoForm
extends ActionForm
6、
2006-04-25 08:56:38,495 ERROR com.xindeco.business.web.action.GraAppAction - com.xindeco.business.web.action.GraAppAction@8e2fb5
java.lang.ClassCastException: $Proxy0
at com.xindeco.business.web.action.GraAppAction.newone(GraAppAction.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at com.xindeco.core.web.action.BaseAction.dispatchMethod(BaseAction.java:153)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
actioin类中的newone方法如下:
public class GraAppAction
extends BaseAction {
public ActionForward newone(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
GraAppService graservice = (GraAppService) this.getBean("GraAppService");
}
applicationcontext中的GraAppService的配置如下:
<bean id="GraAppDAO" class="com.xindeco.business.dao.impl.GraAppDAOImpl">
<property name="support">
<ref local="support"/>
</property>
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<bean id="GraAppService" parent="baseTxProxy">
<property name="target">
<bean class="com.xindeco.business.service.impl.GraAppServiceImpl" autowire="byName">
<property name="baseDAO">
<ref bean="GraAppDAO"/>
</property>
</bean>
</property>
</bean>
因此this.getBean("GraAppService");是为了得到GraAppServicImpl类的实现。GraAppService是interface
public class GraAppServiceImpl extends BaseServiceImpl
implements GraAppService{
}
7、org.hibernate.hql.ast.QuerySyntaxException: Demand is not mapped. [from Demand where unitid = ? and needNum > usedNeedNum]
hibernate.cfg.xml没有配置Demand.hbm.xml文件的目录
8、org.springframework.jdbc.BadSqlGrammarException: Bad SQL grammar [] in task 'Hibernate operation'; nested exception is java.sql.SQLException: 列名 'id' 无效。
java.sql.SQLException: 列名 'name' 无效。
因为hibernate声明的id,name的columnid属性没有与数据库的字段对应,所以id,name无效。
9、java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:415)
at java.lang.Integer.parseInt(Integer.java:497)
at com.xindeco.business.service.impl.DemandServiceImpl.findDemandListByUnitId(DemandServiceImpl.java:33)
错误语句为
needNum = Integer.parseInt(demand.getNeedNum());
usedNeedNum = Integer.parseInt(demand.getUsedNeedNum());
因为demand.getUsedNeedNum()==null,无法转化为string 类型,
10、rg.apache.jasper.JasperException: /GraAppInfo/GraAppInfoNew.jsp(343,29) According to TLD, tag bean:write must be empty, but is not
错误的原因:
<select name="politicsID" >
<option value="">请选择</option>
<logic:notEmpty name="politicsList">
<logic:iterate id="politics" name="politicsList">
</logic:notEmpty>
<option value="<bean:write name="politics" property="codeID"/>"><bean:write name="politics" property="codeName"/></option>
</logic:iterate>
</select>
就因为少了/>
以后懂得通过查找字数,来检查错误
11、2006-04-26 13:27:54,812 ERROR com.xindeco.core.util.BeanUtils - bean property [Nation] copy failed
com.xindeco.core.exception.ConvertException: org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: java.lang.String; nested exception is org.hibernate.MappingException: Unknown entity: java.lang.String
beanUtil.beanCopy(grapojo,form,BizConstants.CONVERTER);
要求:
1、pojo类的属性只有与form属性名字相同,才能beancopy成功
2、pojo中属性是实体,在form中一定要用int,long表示
出现这错误的原因是pojo中的属性不是实体,而错误写成:
string
private String nation;应改成 private Syscode nation;
12、
2006-04-26 14:38:37,843 ERROR com.xindeco.business.web.action.GraAppAction - com.xindeco.business.web.action.GraAppAction@fa1b2d
java.lang.NullPointerException
at com.xindeco.business.web.action.GraAppAction.newone(GraAppAction.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
hibernate配置文件没改,程序找不到相应的类
<many-to-one
name="FSUnit"
class="com.xindeco.business.pojo.EmployUnitBaseInfo"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="fSUnit"
/>
其实FSUnit对应的类应该是FSUnit
<many-to-one
name="FSUnit"
class="com.xindeco.business.pojo.FSUnit"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="fSUnit"
/>
13、
org.hibernate.MappingException: An association from the table GraAppInfo refers to an unmapped class: com.xindeco.business.pojo.FSUnit
错误原因:hibernate.cfg.xml没有配置fsunit.hbm.xml文件的位置
14、
java.lang.ClassCastException: com.xindeco.business.dao.impl.GraAppDAOImpl
at com.xindeco.business.service.impl.GraAppServiceImpl.addGraduateApp(GraAppServiceImpl.java:16)
GraAppServiceImpl.java:16
第16行: GraAppDAO dao = (GraAppDAO) this.getBaseDAO();//其实得到的是GraAppDAOImpl
错误的原因是
public class GraAppDAOImpl
extends BaseDAOImpl {
}
没有实现GraAppDAO接口,正确的做法是
public class GraAppDAOImpl
extends BaseDAOImpl implements GraAppDAO {
}
先继承后实现
15、2006-04-27 08:38:54,078 ERROR com.xindeco.business.web.action.GraAppAction - com.xindeco.business.web.action.GraAppAction@1d6399b
java.lang.ClassCastException: com.xindeco.business.pojo.SysCode
at org.hibernate.type.StringType.set(StringType.java:26)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:63)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:40)
一般是因为hibernate声明类型和pojo类声明的类型不一样,并且前面已经出现了Hibernate: insert into TGraAppInfo (name, whereFrom, degree, college, speciality, studentRelTel, remark, higherEduLength, highSchool, studyResume, normalOrNot, proxyUnit, workPost, workPlace, studentAddress, studentPostNumber, nation, appStatus) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
的操作提示,查出错误的原因有:
<many-to-one
name="demand"
class="com.xindeco.business.pojo.Syscode"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="demandID"
/>
<property
name="appStatus"
type="int"
update="true"
insert="true"
access="property"
column="appStatus"
length="10"
/>
应改为
<many-to-one
name="demand"
class="com.xindeco.business.pojo.Demand"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="demandID"
/>
<many-to-one
name="nation"
class="com.xindeco.business.pojo.SysCode"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="nation"
/>
16、
org.springframework.dao.InvalidDataAccessApiUsageException: object references an unsaved transient instance - save the transient instance before flushing: com.xindeco.business.pojo.SysCode
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:626)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:570)
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:482)
pojo类为:
public class GraAppInfo{
private College college;
}
action 类为
public class GraAppAction
extends BaseAction {
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
graInfo.setCollege(new College());\\必须从数据库找到college这个对象,而不能新生成
graInfo.getCollege().setID(graForm.getCollegeID());
graInfo.setAppStatus(Integer.parseInt("0"));
service.addGraduateApp(graInfo);
}
public class GraAppServiceImpl extends BaseServiceImpl
implements GraAppService{
public boolean addGraduateApp(GraAppInfo info)
{
this.getBaseDAO().save(info);
return true;
}
}
dao类save方法为
getHibernateTemplate().save(obj);
当cascade="all",插入new college 除了id和原来的记录一样,其他的字段全部都被更新,为null
当cascase=“insert”,插入new college 只会把它的id插入grainfo表中,其他字段不变。
17、java.sql.SQLException: Unable to convert between java.lang.Integer and BLOB.
因为
<property
name="province"
type="com.xindeco.business.pojo.SysCode"//不能用复杂类,
update="true"
insert="true"
access="property"
column="provinceId"
/>
应该改为
<many-to-one
name="province"
class="com.xindeco.business.pojo.SysCode"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="provinceId"
/>
18、javax.servlet.jsp.JspException: Cannot create iterator for this collection
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:265)
jsp文件如下:
<logic:notEmpty name="graduateList" >
<logic:iterate id="graduate" name="graduateList" >
</ogic:notEmpty >
</ogic:iterat>
graduateList是一个类,而logic:iterator要求必须是ArrayList,HashSet....这样的集合类,而graduateList中一个属性是ArrayList或HashSet的
应改为:
<logic:notEmpty name="graduateList" property="items">
<logic:iterate id="graduate" name="graduateList" property="items" >
</ogic:notEmpty >
</ogic:iterat>
19、2006-05-11 17:13:37,468 ERROR com.xindeco.business.web.action.GraAppAction - com.xindeco.business.web.action.GraAppAction@bc22eb
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
SysUser user= (SysUser) request.getSession().getAttribute(WebConstants.SESSION_USER);
System.out.println(user.getRole().getRoleName());
当hibernate session取出数据放到http session时,
由于sysuser中role的lazy=“true”,所以没有将RoleName放到http session中,当System.out.println(user.getRole().getRoleName());
时,虽然http session还开着, hibernat seesion已经关闭
<many-to-one
name="role"
class="com.xindeco.business.pojo.SysRole"
lazy="false"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="roleID"
/>
20、Association references unmapped class: com.xindeco.workflow.WFNode
因为application.xml文件中没有配置<mapping resource="com/xindeco/workflow/WFNode.hbm.xml"/>
系统找不到WFNode
<
set
name
=
"
nodes
"
table
=
"
WF_ROLENODES
"
lazy
=
"
true
"
inverse
=
"
false
"
cascade
=
"
none
"
sort
=
"
unsorted
"
>
<
key
column
=
"
roleID
"
>
</
key
>
<
many
-
to
-
many
class
=
"
com.xindeco.workflow.WFNode
"
column
=
"
nodeId
"
outer
-
join
=
"
auto
"
/>
</
set
>
posted @
2006-04-16 15:54 aimy 阅读(2705) |
评论 (1) |
编辑 收藏