1、映射出错
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.springframework.orm.hibernate3.HibernateQueryException: customer is not mapped [from customer where username=? and password=?]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: customer is not mapped [from customer where username=? and password=?] org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656) org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912)
检查:Customer.hbm.xml以及Customer.java文件都没有错误。在applicationContext.xml中也配置了Customer.hbm.xml以及Customer.java。最后查了一天,发现是查询语句中不应该使用表名而应该用映射文件名Customer
2、
type Status report
message No result defined for action onlinemall.customer.action.UserAction and result login
description The requested resource (No result defined for action onlinemall.customer.action.UserAction and result login) is not available.
即:找到了对应的Action但是返回的事login
原因:validate方法有问题,程序没有通过;符合条件进入拦截器,拦截器中返回的是action.login(此处有错)
修改后仍然有错,检查发现MyFIlter拦截器使没有登录的页面跳转到登录页面,不应该在login中使用