随笔分类 -  J2EE

1 2 下一页

Spring2.5中基于注释的IoC
摘要:基于注释(Annotation)的配置有越来越流行的趋势,Spring 2.5 顺应这种趋势,提供了完全基于注释配置 Bean、装配 Bean 的功能,您可以使用基于注释的 Spring IoC 替换原来基于 XML 的配置。注释的优势 它可以充分利用 Java 的反射机制获取类结构信息,这些信息可以有效减少配置的工作。如使用 JPA 注释配置 ORM 映射时,我们就不需要指定 PO 的属性名、类... 阅读全文

posted @ 2009-09-21 09:03 Squall 阅读(415) 评论(0) 推荐(0)

struts2登录拦截器
摘要:[代码] 阅读全文

posted @ 2009-09-20 07:54 Squall 阅读(624) 评论(0) 推荐(0)

Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AU
摘要:Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AU org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are... 阅读全文

posted @ 2009-09-02 16:38 Squall 阅读(21466) 评论(0) 推荐(1)

hibernate.current_session_context_class 错误
摘要:在使用SessionFactory的getCurrentSession方法时遇到如下错误,经过检查,原因如下:是因为在hibernate.cfg.xml文件中忘记进行了如下设置:hibernate.current_session_context_class如果是在web容器中运行hibernate,则在hibernate.cfg.xml中加入这句话:<property name="hiber... 阅读全文

posted @ 2009-07-02 13:47 Squall 阅读(3002) 评论(0) 推荐(0)

Lucene中使用Paoding中文分词
摘要:1,把paoding-analysis-2.0.4-beta解压缩,给项目中加入paoding-analysis.jar。2,把dic文件夹放到项目的根目录中。dic文件夹里是paoding的词库。3,配置paoding的词库:把paoding-analysis-2.0.4-beta\src里面的paoding-dic-home.properties拷贝到项目的根目录下。编辑如下:Xml代码 #v... 阅读全文

posted @ 2009-06-30 16:09 Squall 阅读(6908) 评论(0) 推荐(0)

Cant connect to SQL server with jtds 1.2.2
摘要:What i did was to add commons-dbcp-1.2.2.jar commons-pool-1.4.jar commons-collections-3.2.1.jar - already added initially to the class path of the application and tomcat and add factory="org.apache.co... 阅读全文

posted @ 2009-02-24 15:43 Squall 阅读(389) 评论(0) 推荐(0)

The hibernate core class ------ ExportToDB
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->import org.hibernate.cfg.Configuration; import org.hibernate.tool.hbm2ddl.SchemaExport; ... 阅读全文

posted @ 2009-02-08 01:57 Squall 阅读(170) 评论(0) 推荐(0)

Struts+spring使用随机验证码
摘要:struts-config.xml validation.xml spring config checkAction.java public class CheckAction extends Action { /* * G... 阅读全文

posted @ 2009-01-09 11:04 Squall 阅读(445) 评论(0) 推荐(0)

SSH 异常 解决 方案 总结
摘要:1.对一个需要提供稳定、高质量的WEB系统而言, 对整个WEB程序的入口、出口的异常处理都需要做封装。 2.Logic、DAO可以根据需要,向上层抛出相应的Exception, 而这些Exception都必须在Action截住,也就是封装起来,向View返回一个合适的信息。 3.发生异常之后,返回到View的信息,可以是给人看得HTML也可以是给JavaScript看的JSON, 所以,... 阅读全文

posted @ 2009-01-07 17:22 Squall 阅读(2964) 评论(1) 推荐(0)

Struts-Logic 标签库
摘要:Struts-Logic 标签库 此标签库可以分为三种类型:条件、循环、转发/重定向。 一.) 条件类型 logic:empty和logic:notEmpty logic:empty标签判断脚本变量是否为null,是否是一个空的字符串(长度为0),是否是一个空的collection或map(调用isEmpty()方法来判断)。logic:notEmpty标签类似。 ... 阅读全文

posted @ 2009-01-07 14:05 Squall 阅读(801) 评论(0) 推荐(0)

structs - 标签库(html)
摘要:structs - 标签库(html) Struts提供了五个标签库,即:HTML、Bean、Logic、Template和Nested。 标签库 说明 HTML 标签 ... 阅读全文

posted @ 2009-01-07 14:04 Squall 阅读(982) 评论(0) 推荐(0)

spring2.0 事务管理以及异常处理之体会
摘要:开发环境: OS:windows 2003 Server Web Server: jakarta-tomcat-5.0.28 DataBase Server: MS SQL Server 2000 (打了SP3补丁) IDE: Eclipse 3.2.0+MyEclipse 5.0GA 测试案例系统结构: web层Service层DAO层 web层使用struts 1.1,DA... 阅读全文

posted @ 2009-01-07 10:44 Squall 阅读(2105) 评论(1) 推荐(0)

Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
摘要:错误如下: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from resource [/WEB-INF/applicationContext.xml] of ServletContext; nested exception is java.io.Fi... 阅读全文

posted @ 2009-01-05 09:37 Squall 阅读(11874) 评论(1) 推荐(0)

myeclipse tomcat 部署错误
摘要:myeclipse tomcat 部署错误: Deployment failure on Tomcat 6.x. Could not copy all resources to C:\tomcat6\webapps\OAPMS. If a file is locked, you can wait until the lock times out to redeploy, or stop the s... 阅读全文

posted @ 2009-01-05 09:22 Squall 阅读(2396) 评论(0) 推荐(0)

Cannot find message resources under key org.apache.struts.action.MESSAGE
摘要:Struts时遇到的问题: 运行程序出现Cannot find message resources under key org.apache.struts.action.MESSAGE错误,是说明找不到ApplicationResources.properties,要注意以下四方面。 第一:在web.xml文件 "把下面的内容放在这里"中加入 application ... 阅读全文

posted @ 2008-11-27 14:29 Squall 阅读(6484) 评论(0) 推荐(1)

解决:No configuration found. Configuring ehcache from ehcache-failsafe.xml 问题
摘要:No configuration found. Configuring ehcache from ehcache-failsafe.xml ehcache-failsafe.xml 是来自于ehcache-1.1.jar包,但原因并不是找不到 ehcache-failsafe.xml 而造成的错误, 把 ehcache-1.1.jar包里的 ehcache-failsafe.xml 抽取出... 阅读全文

posted @ 2008-10-26 16:20 Squall 阅读(7541) 评论(0) 推荐(1)

关于异常 Underlying input stream returned zero bytes 解决办法
摘要:系统环境 jdk1.5 hibernate 3.0 sql server 2000 ms jdbc driver 将一个varchar类型的字段改为text后,就出现 [Microsoft][SQLServer 2000 Driver for JDBC]Underlying input stream returned zero bytes 的异常了。 从网上搜集资料来看,由于jdbc的bug,所以... 阅读全文

posted @ 2008-09-12 16:10 Squall 阅读(1279) 评论(0) 推荐(0)

BeanUtils.populate&argument type mismatch - [Struts]
摘要:1.继承 ActionForm 的类的所有字段必须为 String 型 2.由于 Date 型转换为 String 需设置 DateFormat ,所以你 Bean 里的日期字段最好用 String 这样就不会出现类型转换错误了。 阅读全文

posted @ 2008-09-12 14:52 Squall 阅读(450) 评论(0) 推荐(0)

HQL 语法 明细
摘要:HQL 例如对于TUser类 1.实体查询 String hql = " from TUser"; 执行这条语句会返回TUser以及TUser子类的纪录。 注: 如果 TUser 类具有外键, 查询会报错! 解决方法: select 别名.属性 from 类 as 别名. 没有别名.属性仍然报错! hql = "from java.lang.Object" 会返回数据库中所有库表... 阅读全文

posted @ 2008-09-10 14:51 Squall 阅读(14592) 评论(6) 推荐(3)

解决mysql+hibernate在j2ee框架下的数据库中文乱码问题
摘要:1、可以不在struts下使用过滤器,可直接把过滤器写在web.xml中 2、配置好filter类之后,要在hibernate配置文件中 加入以下代码: true UTF-8 3、在创建MYSQL 数据库表的同时 加上 DEFAULT CHARSET =UTF8; 即可针对MYSQL表 进行编码转换, 如果对数据库设置编码,也可以, 但个人... 阅读全文

posted @ 2008-08-11 13:27 Squall 阅读(403) 评论(0) 推荐(0)

1 2 下一页

导航