Tuesday, April 25, 2006

The solutions to the problem:ClassNotFoundException: org.hibernate.hql.ast.HqlToken

When I run the example provided by the Hibernate 3.1.3 package, "ant eg", I got the error: "ClassNotFoundException: org.hibernate.hql.ast.HqlToken.
The solutions have two which I tried and succeeded.
1: place the antlr-2.7.6rc1.jar into the jdk.xxx/jre/lib/ext directory of jdk package.
2: set the "hibernate.query.factory_class" to "org.hibernate.hql.classic.ClassicQueryTranslatorFactory" in the "hibernate.properties" file.
3: Or add the following sentence into the hibernate.cfg.xml file: org.hibernate.hql.classic.ClassicQueryTranslatorFactory

Monday, April 24, 2006

To run Hibernate example, We must put log4jXXX.jar into the "ext" directory of JDK

To run Hibernate example successfully, We must place log4jXXX.jar into the "jre/ext" directory of JDK (like: JDK1.5.0_06). for example, we can run the example provided by Hibernate package: "ant eg".
otherwise, it will have an error:
java.lang.ExceptionInInitializerError at......
....
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor
.....

Sunday, April 16, 2006

安装struts的注意事项

1:copy "struts.jar" and "servlet-api.jar" to the directory, something like: E:\jdk1.5.0_06\jre\lib\ext. 注意拷到 jre 之下, 其中 servlet-api.jar 是由应用服务器,如tomcat提供的。这样用javac在编译beans才能通过

Tuesday, April 04, 2006

使用html:link tag 传递带空格的参数所产生的问题


我有上面的语句,其中dishNameForUrl的值带有空格,如:chicken curry .
这时产生的url为: "xxxx/dish.do?dish1=chichen+curry" . 其中空格自动转换成了“+“符号。如果想保留空格,或者成为"xxxx/dish.do?dish1=chichen%20curry" 请问该如何处理? 我知道用“a href...<%=... %> />“或许能解决这个问题. 但如果只用 html link tag能解决这个问题吗?