Struts has detected an unhandled exception:
Messages:
could not initialize proxy - no Session
Error reading 'nameCn' on type entity.Position_$$_javassist_5
An exception occurred processing JSP page /WEB-INF/page/index.jsp at line 33 30: 31:
32:${employee.position.nameCn}
Stacktrace:
File: org/hibernate/proxy/AbstractLazyInitializer.java
Line number: 132
下面是代码
public String toIndex(){
employee = (Employee)ActionContext.getContext().getSession().get("employee");
return "toIndex";
}
public String login(){
employee = ls.queryLogin(employee);
if(employee!=null){
ActionContext.getContext().getSession().put("employee", employee);
return "reIndex";
}
return "toLogin";
}
然后是配置
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
求大佬帮忙