![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
iteye_19679
这个作者很懒,什么都没留下…
展开
-
Spring配置文件中id的第二个字母不能大写问题 (转)
Spring配置文件中id的第二个字母不能大写问题 http://xiaotian-ls.iteye.com/blog/273232 今天遇到一个问题,在spring配置文件中的id第二个字母不能大写,否则会产生异常:Bean property 'kManager' is not writable or has an invalid setter method. Did yo...原创 2010-02-10 17:16:53 · 445 阅读 · 0 评论 -
spring web启动时spring初始化并执行某个类
web启动时spring初始化并执行某个类看了好几种方法,还是个这最靠谱了 @Componentpublic class SysInitBean implements InitializingBean,ServletContextAware{ public void afterPropertiesSet() throws Exception { //你的初始化代码 }}实现I...原创 2013-06-28 14:33:04 · 677 阅读 · 0 评论 -
spring security 2添加用户验证码
spring security 2安全功能,添加用户验证码的实现,方案有3个:方案1、由于AuthenticationProcessingFilter过滤器是拦截/j_spring_security_check地址,他的实现类里只读取的j_username和j_password,没有读取其他的用户登陆信息,所以我就把验证码(code)在login.jsp页面和j_username拼装在一起,在U...原创 2013-05-25 20:50:56 · 71 阅读 · 0 评论 -
Spring的自动任务中调用业务类方法
Spring 中使用 QuartzJobBean 来进行定时任务的操作 代码如下:@Controller @Scope("prototype")public class QuartzSyncJob extends QuartzJobBean { private MsgBusinessImpl msgBusinessImpl ; public void setMsgBu...原创 2012-03-21 15:18:16 · 183 阅读 · 0 评论 -
Spring 注入失败的原因
有一次写代码如下 ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); HarborBusiness service = (HarborBusiness) ctx.getBean("harborBusiness"); 总是报no bean named 查了半天没查出来了,后来把前一...原创 2012-03-14 13:21:57 · 337 阅读 · 0 评论 -
Spring中bean的实例化顺序
加载顺序: 先构造函数——>然后是b的set方法注入——>InitializingBean的afterPropertiesSet方法——>init-method方法 以下内容是从书中摘录来的,但是我发现即使摘录一遍,对其内容的理解也会更加深入! Spring装配Bean的过程 1. 实例化; 2. 设置属性值; 3. 如果实现了BeanName...原创 2010-07-23 15:21:19 · 127 阅读 · 0 评论 -
如何在Spring中实例化非Action类
如何在Spring中实例化非Action类开发过程中碰到一个问题,无论如何都不能在非Action中调用通过Spring实例化的类,在小强的帮助下解决了这个问题。:) 案例: 一个Tag需要调用一个鉴权Service,但是Tag不是Action,没有在Spring中注册,虽然service通过Application-Context.xml中初始化,但是Tag是不能通过Clas...原创 2010-07-23 15:14:05 · 70 阅读 · 0 评论 -
Spring加载机制代码 转
Spring加载机制代码<!--基本属性-->2010-05-19 11:00:28 作者:本站 来源:本站 浏览次数:0 <!--简单描述-->只是一个是基于Servlet2.3版本中新引入的Listener接口实现,而另一个基于Servlet接口实现。开发中可根据目标Web容器的实际情况进行选择..<!--正文--><!--判...原创 2010-12-22 15:46:37 · 93 阅读 · 0 评论 -
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
我在使用Struts2进行开发的时候老是报下面的错误: 严重: Exception starting filter struts2 java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory 开发使用的是Struts2.0.9版本(用2.1.6测试也有相同的问题出现),应用服务器用的是tomcat6.0; 我在网上找了...原创 2011-08-02 12:46:15 · 134 阅读 · 0 评论 -
Spring注解入门 scope为'request'异常问题
Spring注解入门 更多相关推荐 这个问题花费了我几个小时,我已经在web.xml中添加了RequestContextListener监听器,而且在配置'KnowledgeService'这个bean中也使用scope为'request',但是不抛出异常。而在配置'UserService'这个bean时硬是抛出了下面这个异常: Error creating bean with name 'U...2010-03-11 16:15:43 · 1028 阅读 · 0 评论 -
基于Annotation的Struts2.0+Hibernate3.3+Spring2.5整合开发(转)
进入我们基于Annotation的Struts2.0+Hibernate3.3+Spring2.5整合开发的最后一个阶段了,这阶段主要为我们的项目引进Struts2的Annotation。相对于带Annotation的Hibernate与带Annotation的Spring整合来说,带Annotation的Struts与带Annotation的Spring整合还是比较容易实现的。 我们先...2010-03-11 15:02:05 · 79 阅读 · 0 评论 -
struts2+spring中action的生命周期问题(转)
struts2+spring中action的生命周期问题文章分类:Java编程 将struts2中的action交给spring管理如果没有指定scope就会出现验证时第一次验证的结果一直存在,导致后面的验证根本没有进行所以在spring中配置action时要指定scope属性为prototype<bean id="randomImageAction"cla...2010-03-11 14:41:56 · 74 阅读 · 0 评论 -
Spring的注入问题(转)
spring中可以只用autowire="byName"或者"byType"来提供自动注入。但是大家有一点还需要注意,那就是它不支持基本数据类型(String,int,long等)的自动注入。例欢迎转载,但请保留出处,本文章转自[华软网] 原文链接:http://www.huarw.com/program/java/java03/200902/1662822.html 一个用于s...2010-03-11 11:55:26 · 76 阅读 · 0 评论 -
ognl.MethodFailedException: Method "setId" failed for object
log4jStrutsJavaWeb ognl.MethodFailedException: Method "setId" failed for object com.provence.zbtb.web.enterprise.EnterpriseListAction@1f99d54 [java.lang.NoSuchMethodException: setId([Lja...原创 2013-04-23 20:27:29 · 397 阅读 · 0 评论