1、QuerySyntaxException: unexpected token ——hql语句中where错拼成whrer
2、The path of an ForwardConfig cannot be null ——使用了validation的话,struts-config.xml里配置action必须加上input=某页面 ,因为validation验证通不过时会自动跳转到某页面。
3、mapping.findForward(" ") ——引号里面不能直接写网页地址,必须是struts-config.xml里配置的forward name
4、warning:Positional parameter are considered deprecated; use named parameters or JPA-style positional parame —— hibernate 警告应该使用符合新规范的占位符,如:
String hql = "FROM Users WHERE userName = ?0 AND userPassword = ?1";
Query query = session.createQuery(hql).setParameter("0", "userName").setParameter("1","userPassword");String hql = "FROM Users WHERE userName = :userName AND userPassword = :userPassword";
Query query = session.createQuery(hql).setParameter("userName", "userName").setParameter("userPassword","userPassword");5、${ } EL表达式不生效,在jsp页面加上 <%@ page isELIgnored="false" %> ,或者去掉web.xml里的<!DOCTYPE >元素,将根元素<web-app>的属性设置为
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
原因: servlets 2.3(对应jsp 1.2)或更早版本默认忽略el表达式,之后的版本才默认识别el表达式。
本文介绍了在Struts1、Hibernate和EL表达式结合使用时遇到的一些常见问题及解决方案,包括HQL语法错误、Struts配置中的验证问题、页面转发配置、Hibernate的警告以及EL表达式不生效的问题。通过解决这些问题,可以更好地理解和优化基于这些技术的注册登录功能。
3732

被折叠的 条评论
为什么被折叠?



