You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(387) |
May
(1066) |
Jun
(689) |
Jul
(504) |
Aug
(697) |
Sep
(660) |
Oct
(591) |
Nov
(393) |
Dec
(324) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(567) |
Feb
(448) |
Mar
(461) |
Apr
(368) |
May
(887) |
Jun
(243) |
Jul
(429) |
Aug
(670) |
Sep
(648) |
Oct
(684) |
Nov
(599) |
Dec
(317) |
2008 |
Jan
(388) |
Feb
(400) |
Mar
(323) |
Apr
(214) |
May
(228) |
Jun
(120) |
Jul
(168) |
Aug
(64) |
Sep
(78) |
Oct
(127) |
Nov
(28) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:33
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/hibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/orm/hibernate Modified Files: Tag: mbranch-1-2 HibernateInterceptor.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: HibernateInterceptor.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate/HibernateInterceptor.java,v retrieving revision 1.16 retrieving revision 1.16.4.1 diff -C2 -d -r1.16 -r1.16.4.1 *** HibernateInterceptor.java 21 Jul 2005 14:19:29 -0000 1.16 --- HibernateInterceptor.java 21 Apr 2006 19:39:58 -0000 1.16.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 36,40 **** * thread-bound Session. It is preferable to use <code>getSession</code> with * allowCreate=false, if the code relies on the interceptor to provide proper ! * Session handling. Typically, the code will look as follows: * * <pre> --- 36,40 ---- * thread-bound Session. It is preferable to use <code>getSession</code> with * allowCreate=false, if the code relies on the interceptor to provide proper ! * Session handling. Typically, the code will look like as follows: * * <pre> *************** *** 55,61 **** * * <p>Unfortunately, this interceptor cannot convert checked HibernateExceptions ! * to unchecked dao ones automatically. The intercepted method would have to throw ! * HibernateException to be able to achieve this - thus the caller would still have ! * to catch or rethrow it, even if it will never be thrown if intercepted. * * <p>This class can be considered a declarative alternative to HibernateTemplate's --- 55,62 ---- * * <p>Unfortunately, this interceptor cannot convert checked HibernateExceptions ! * to unchecked dao ones transparently. The intercepted method would have to declare ! * the checked HibernateException - thus the caller would still have to catch or ! * rethrow it, even if it will never be thrown if intercepted. Any such exception ! * will nevertheless get converted by default. * * <p>This class can be considered a declarative alternative to HibernateTemplate's |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:33
|
Update of /cvsroot/springframework/spring/src/org/springframework/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/util Modified Files: Tag: mbranch-1-2 AntPathMatcher.java ResourceUtils.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: ResourceUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/util/ResourceUtils.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** ResourceUtils.java 13 Nov 2005 23:23:32 -0000 1.6 --- ResourceUtils.java 21 Apr 2006 19:39:59 -0000 1.6.2.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 66,69 **** --- 66,72 ---- */ public static boolean isUrl(String resourceLocation) { + if (resourceLocation == null) { + return false; + } if (resourceLocation.startsWith(CLASSPATH_URL_PREFIX)) { return true; *************** *** 88,91 **** --- 91,95 ---- */ public static URL getURL(String resourceLocation) throws FileNotFoundException { + Assert.notNull(resourceLocation, "Resource location must not be null"); if (resourceLocation.startsWith(CLASSPATH_URL_PREFIX)) { String path = resourceLocation.substring(CLASSPATH_URL_PREFIX.length()); *************** *** 126,129 **** --- 130,134 ---- */ public static File getFile(String resourceLocation) throws FileNotFoundException { + Assert.notNull(resourceLocation, "Resource location must not be null"); if (resourceLocation.startsWith(CLASSPATH_URL_PREFIX)) { String path = resourceLocation.substring(CLASSPATH_URL_PREFIX.length()); *************** *** 170,173 **** --- 175,179 ---- */ public static File getFile(URL resourceUrl, String description) throws FileNotFoundException { + Assert.notNull(resourceUrl, "Resource URL must not be null"); if (!URL_PROTOCOL_FILE.equals(resourceUrl.getProtocol())) { throw new FileNotFoundException( Index: AntPathMatcher.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/util/AntPathMatcher.java,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** AntPathMatcher.java 23 Dec 2005 13:50:15 -0000 1.2.4.1 --- AntPathMatcher.java 21 Apr 2006 19:39:59 -0000 1.2.4.2 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 33,38 **** * <p>Some examples:<br> * <ul> ! * <li><code>com/t?st.jsp</code> - matches <code>test.jsp</code> but also ! * <code>tast.jsp</code> or <code>txst.jsp</code></li> * <li><code>com/*.jsp</code> - matches all <code>.jsp</code> files in the * <code>com</code> directory</li> --- 33,38 ---- * <p>Some examples:<br> * <ul> ! * <li><code>com/t?st.jsp</code> - matches <code>com/test.jsp</code> but also ! * <code>com/tast.jsp</code> or <code>com/txst.jsp</code></li> * <li><code>com/*.jsp</code> - matches all <code>.jsp</code> files in the * <code>com</code> directory</li> |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:33
|
Update of /cvsroot/springframework/spring/src/org/springframework/jms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/jms Modified Files: Tag: mbranch-1-2 JmsException.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: JmsException.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jms/JmsException.java,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** JmsException.java 2 Oct 2005 19:31:43 -0000 1.10 --- JmsException.java 21 Apr 2006 19:39:58 -0000 1.10.2.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 56,60 **** * expected to be a proper subclass of {@link javax.jms.JMSException}. */ ! protected JmsException(Throwable cause) { super(cause != null ? cause.getMessage() : null, cause); } --- 56,60 ---- * expected to be a proper subclass of {@link javax.jms.JMSException}. */ ! public JmsException(Throwable cause) { super(cause != null ? cause.getMessage() : null, cause); } *************** *** 79,101 **** */ public String getMessage() { ! // Even if you cannot set the cause of this exception other than through ! // the constructor, we check for the cause being "this" here, as the cause ! // could still be set to "this" via reflection: for example, by a remoting ! // deserializer like Hessian's. ! if (getCause() == null || getCause() == this) { ! return super.getMessage(); ! } ! else { ! if (getCause().getClass().isAssignableFrom(JMSException.class) && ! ((JMSException)getCause()).getLinkedException() != null) { ! Exception le = ((JMSException) getCause()).getLinkedException(); ! return super.getMessage() + "; nested exception is " + le.getClass().getName() + ! ": " + le.getMessage(); ! } ! else { ! return super.getMessage() + "; nested exception is " + getCause().getClass().getName() + ! ": " + getCause().getMessage(); } } } --- 79,91 ---- */ public String getMessage() { ! String message = super.getMessage(); ! Throwable cause = getCause(); ! if (cause instanceof JMSException) { ! Exception linkedEx = ((JMSException) cause).getLinkedException(); ! if (linkedEx != null) { ! message = message + "; nested exception is " + linkedEx; } } + return message; } |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:33
|
Update of /cvsroot/springframework/spring/src/org/springframework/transaction/jta In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/transaction/jta Modified Files: Tag: mbranch-1-2 JotmFactoryBean.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: JotmFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/transaction/jta/JotmFactoryBean.java,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** JotmFactoryBean.java 2 Oct 2005 19:35:07 -0000 1.12 --- JotmFactoryBean.java 21 Apr 2006 19:39:58 -0000 1.12.2.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 47,50 **** --- 47,52 ---- * <property name="driverName" value="..."/> * <property name="url" value="..."/> + * <property name="user" value="..."/> + * <property name="password" value="..."/> * </bean> * |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:33
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/toplink In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/orm/toplink Modified Files: Tag: mbranch-1-2 SessionFactoryUtils.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: SessionFactoryUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/toplink/SessionFactoryUtils.java,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -d -r1.8 -r1.8.4.1 *** SessionFactoryUtils.java 13 Sep 2005 21:23:19 -0000 1.8 --- SessionFactoryUtils.java 21 Apr 2006 19:39:58 -0000 1.8.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 166,169 **** --- 166,175 ---- return new TopLinkJdbcException((DatabaseException) ex); } + if (ex instanceof OptimisticLockException) { + return new TopLinkOptimisticLockingFailureException((OptimisticLockException) ex); + } + if (ex instanceof QueryException) { + return new TopLinkQueryException((QueryException) ex); + } if (ex instanceof ConcurrencyException) { return new ConcurrencyFailureException(ex.getMessage(), ex); *************** *** 172,181 **** return new TypeMismatchDataAccessException(ex.getMessage(), ex); } - if (ex instanceof QueryException) { - return new TopLinkQueryException((QueryException) ex); - } - if (ex instanceof OptimisticLockException) { - return new TopLinkOptimisticLockingFailureException((OptimisticLockException) ex); - } // fallback return new TopLinkSystemException(ex); --- 178,181 ---- |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:32
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/orm/hibernate3 Modified Files: Tag: mbranch-1-2 HibernateInterceptor.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: HibernateInterceptor.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/hibernate3/HibernateInterceptor.java,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -C2 -d -r1.7 -r1.7.4.1 *** HibernateInterceptor.java 21 Jul 2005 14:19:34 -0000 1.7 --- HibernateInterceptor.java 21 Apr 2006 19:39:58 -0000 1.7.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 33,62 **** * * <p>Application code must retrieve a Hibernate Session via the ! * <code>SessionFactoryUtils.getSession</code> method, to be able to detect a ! * thread-bound Session. It is preferable to use <code>getSession</code> with ! * allowCreate=false, if the code relies on the interceptor to provide proper ! * Session handling. Typically, the code will look as follows: * * <pre> * public void doHibernateAction() { ! * Session session = SessionFactoryUtils.getSession(this.sessionFactory, false); ! * try { ! * ... ! * } ! * catch (HibernateException ex) { ! * throw SessionFactoryUtils.convertHibernateAccessException(ex); ! * } * }</pre> * ! * Note that the application must care about handling HibernateExceptions itself, ! * preferably via delegating to the <code>SessionFactoryUtils.convertHibernateAccessException</code> * method that converts them to exceptions that are compatible with the * <code>org.springframework.dao</code> exception hierarchy (like HibernateTemplate does). * - * <p>Unfortunately, this interceptor cannot convert checked HibernateExceptions - * to unchecked dao ones automatically. The intercepted method would have to throw - * HibernateException to be able to achieve this - thus the caller would still have - * to catch or rethrow it, even if it will never be thrown if intercepted. - * * <p>This class can be considered a declarative alternative to HibernateTemplate's * callback approach. The advantages are: --- 33,52 ---- * * <p>Application code must retrieve a Hibernate Session via the ! * <code>SessionFactoryUtils.getSession</code> method or - preferably - ! * Hibernate's own <code>SessionFactory.getCurrentSession()</code> method, to be ! * able to detect a thread-bound Session. Typically, the code will look like as follows: * * <pre> * public void doHibernateAction() { ! * Session session = this.sessionFactory.getCurrentSession(); ! * ... ! * // No need to close the Session or translate exceptions! * }</pre> * ! * Note that this interceptor automatically translates HibernateExceptions, ! * via delegating to the <code>SessionFactoryUtils.convertHibernateAccessException</code> * method that converts them to exceptions that are compatible with the * <code>org.springframework.dao</code> exception hierarchy (like HibernateTemplate does). * * <p>This class can be considered a declarative alternative to HibernateTemplate's * callback approach. The advantages are: *************** *** 66,78 **** * </ul> * ! * <p>The drawbacks are: ! * <ul> ! * <li>the dependency on interceptor configuration; ! * <li>the delegating try/catch blocks. ! * </ul> * * @author Juergen Hoeller * @since 1.2 ! * @see SessionFactoryUtils#getSession * @see HibernateTransactionManager * @see HibernateTemplate --- 56,69 ---- * </ul> * ! * <p>The drawback is the dependency on interceptor configuration. However, note ! * that this interceptor is usually <i>not</i> necessary in scenarios where the ! * data access code always executes within transactions. A transaction will always ! * have a thread-bound Session in the first place, so adding this interceptor to the ! * configuration just adds value when fine-tuning Session settings like the flush mode ! * - or when relying on exception translation. * * @author Juergen Hoeller * @since 1.2 ! * @see org.hibernate.SessionFactory#getCurrentSession() * @see HibernateTransactionManager * @see HibernateTemplate |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:32
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/beans/factory/support Modified Files: Tag: mbranch-1-2 AbstractAutowireCapableBeanFactory.java SimpleInstantiationStrategy.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: AbstractAutowireCapableBeanFactory.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java,v retrieving revision 1.81.2.4 retrieving revision 1.81.2.5 diff -C2 -d -r1.81.2.4 -r1.81.2.5 *** AbstractAutowireCapableBeanFactory.java 21 Feb 2006 18:23:39 -0000 1.81.2.4 --- AbstractAutowireCapableBeanFactory.java 21 Apr 2006 19:39:56 -0000 1.81.2.5 *************** *** 179,183 **** * dependencies that are resolved in other ways, like BeanFactory through * BeanFactoryAware or ApplicationContext through ApplicationContextAware. ! * <p>By default, only the BeanFactory interface is ignored. * For further types to ignore, invoke this method for each type. * @see org.springframework.beans.factory.BeanFactoryAware --- 179,183 ---- * dependencies that are resolved in other ways, like BeanFactory through * BeanFactoryAware or ApplicationContext through ApplicationContextAware. ! * <p>By default, only the BeanFactoryAware interface is ignored. * For further types to ignore, invoke this method for each type. * @see org.springframework.beans.factory.BeanFactoryAware *************** *** 298,302 **** throw new BeanCreationException(beanName, "postProcessAfterInitialization method of BeanPostProcessor [" + beanProcessor + ! "] returned null for bean [" + result + "] with name [" + beanName + "]"); } } --- 298,302 ---- throw new BeanCreationException(beanName, "postProcessAfterInitialization method of BeanPostProcessor [" + beanProcessor + ! "] returned null for bean [" + result + "] with name [" + beanName + "]"); } } *************** *** 958,962 **** for (int i = 0; i < pds.length; i++) { if (pds[i].getWriteMethod() != null && !isExcludedFromDependencyCheck(pds[i]) && ! !pvs.contains(pds[i].getName()) && !BeanUtils.isSimpleProperty(pds[i].getPropertyType())) { result.add(pds[i].getName()); } --- 958,962 ---- for (int i = 0; i < pds.length; i++) { if (pds[i].getWriteMethod() != null && !isExcludedFromDependencyCheck(pds[i]) && ! !pvs.contains(pds[i].getName()) && !BeanUtils.isSimpleProperty(pds[i].getPropertyType())) { result.add(pds[i].getName()); } *************** *** 987,991 **** for (int i = 0; i < pds.length; i++) { if (pds[i].getWriteMethod() != null && !isExcludedFromDependencyCheck(pds[i]) && ! !pvs.contains(pds[i].getName())) { boolean isSimple = BeanUtils.isSimpleProperty(pds[i].getPropertyType()); boolean unsatisfied = (dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_ALL) || --- 987,991 ---- for (int i = 0; i < pds.length; i++) { if (pds[i].getWriteMethod() != null && !isExcludedFromDependencyCheck(pds[i]) && ! !pvs.contains(pds[i].getName())) { boolean isSimple = BeanUtils.isSimpleProperty(pds[i].getPropertyType()); boolean unsatisfied = (dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_ALL) || *************** *** 995,999 **** throw new UnsatisfiedDependencyException( mergedBeanDefinition.getResourceDescription(), beanName, pds[i].getName(), ! "set this property value or disable dependency checking for this bean"); } } --- 995,999 ---- throw new UnsatisfiedDependencyException( mergedBeanDefinition.getResourceDescription(), beanName, pds[i].getName(), ! "Set this property value or disable dependency checking for this bean."); } } Index: SimpleInstantiationStrategy.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java,v retrieving revision 1.9.4.1 retrieving revision 1.9.4.2 diff -C2 -d -r1.9.4.1 -r1.9.4.2 *** SimpleInstantiationStrategy.java 23 Dec 2005 13:50:11 -0000 1.9.4.1 --- SimpleInstantiationStrategy.java 21 Apr 2006 19:39:56 -0000 1.9.4.2 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 34,39 **** * * <p>Does not support Method Injection, although it provides hooks for subclasses ! * to override to add Method Injection support, for example by overriding methods. ! * * @author Rod Johnson * @since 1.1 --- 34,39 ---- * * <p>Does not support Method Injection, although it provides hooks for subclasses ! * to override to add Method Injection support, for example by overriding methods. ! * * @author Rod Johnson * @since 1.1 |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:32
|
Update of /cvsroot/springframework/spring/src/org/springframework/context/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/context/support Modified Files: Tag: mbranch-1-2 ReloadableResourceBundleMessageSource.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: ReloadableResourceBundleMessageSource.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/context/support/ReloadableResourceBundleMessageSource.java,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -C2 -d -r1.23 -r1.23.2.1 *** ReloadableResourceBundleMessageSource.java 7 Oct 2005 12:19:03 -0000 1.23 --- ReloadableResourceBundleMessageSource.java 21 Apr 2006 19:39:56 -0000 1.23.2.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 196,202 **** * <ul> * <li>Default is "-1", indicating to cache forever (just like ! * java.util.ResourceBundle). * <li>A positive number will cache loaded properties files for the given ! * number of seconds. This is essentially the interval between refresh attempts. * Note that a refresh attempt will first check the last-modified timestamp * of the file before actually reloading it; so if files don't change, this --- 196,202 ---- * <ul> * <li>Default is "-1", indicating to cache forever (just like ! * <code>java.util.ResourceBundle</code>). * <li>A positive number will cache loaded properties files for the given ! * number of seconds. This is essentially the interval between refresh checks. * Note that a refresh attempt will first check the last-modified timestamp * of the file before actually reloading it; so if files don't change, this *************** *** 207,211 **** */ public void setCacheSeconds(int cacheSeconds) { ! this.cacheMillis = cacheSeconds * 1000; } --- 207,211 ---- */ public void setCacheSeconds(int cacheSeconds) { ! this.cacheMillis = (cacheSeconds * 1000); } *************** *** 544,551 **** /** * Clear the resource bundle cache. ! * Following resolve calls will lead to reloading of the properties files. */ public void clearCache() { ! logger.info("Clearing resource bundle cache"); synchronized (this.cachedProperties) { this.cachedProperties.clear(); --- 544,551 ---- /** * Clear the resource bundle cache. ! * Subsequent resolve calls will lead to reloading of the properties files. */ public void clearCache() { ! logger.debug("Clearing entire resource bundle cache"); synchronized (this.cachedProperties) { this.cachedProperties.clear(); |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:32
|
Update of /cvsroot/springframework/spring/src/org/springframework/core/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/core/io Modified Files: Tag: mbranch-1-2 ResourceEditor.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: ResourceEditor.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/core/io/ResourceEditor.java,v retrieving revision 1.13 retrieving revision 1.13.4.1 diff -C2 -d -r1.13 -r1.13.4.1 *** ResourceEditor.java 9 Sep 2005 23:00:40 -0000 1.13 --- ResourceEditor.java 21 Apr 2006 19:39:56 -0000 1.13.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 19,22 **** --- 19,23 ---- import java.beans.PropertyEditorSupport; + import org.springframework.util.StringUtils; import org.springframework.util.SystemPropertyUtils; *************** *** 62,67 **** public void setAsText(String text) { ! String locationToUse = resolvePath(text).trim(); ! setValue(this.resourceLoader.getResource(locationToUse)); } --- 63,73 ---- public void setAsText(String text) { ! if (StringUtils.hasText(text)) { ! String locationToUse = resolvePath(text).trim(); ! setValue(this.resourceLoader.getResource(locationToUse)); ! } ! else { ! setValue(null); ! } } |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:31
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/jdbc/support Modified Files: Tag: mbranch-1-2 GeneratedKeyHolder.java SQLErrorCodeSQLExceptionTranslator.java sql-error-codes.xml Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: sql-error-codes.xml =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/support/sql-error-codes.xml,v retrieving revision 1.12.4.2 retrieving revision 1.12.4.3 diff -C2 -d -r1.12.4.2 -r1.12.4.3 *** sql-error-codes.xml 18 Feb 2006 12:03:26 -0000 1.12.4.2 --- sql-error-codes.xml 21 Apr 2006 19:39:58 -0000 1.12.4.3 *************** *** 58,67 **** <value>1054,1064,1146</value> </property> - <property name="dataIntegrityViolationCodes"> - <value>1062</value> - </property> <property name="dataAccessResourceFailureCodes"> <value>1</value> </property> <property name="cannotAcquireLockCodes"> <value>1205</value> --- 58,67 ---- <value>1054,1064,1146</value> </property> <property name="dataAccessResourceFailureCodes"> <value>1</value> </property> + <property name="dataIntegrityViolationCodes"> + <value>1062</value> + </property> <property name="cannotAcquireLockCodes"> <value>1205</value> Index: SQLErrorCodeSQLExceptionTranslator.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java,v retrieving revision 1.21 retrieving revision 1.21.4.1 diff -C2 -d -r1.21 -r1.21.4.1 *** SQLErrorCodeSQLExceptionTranslator.java 13 Sep 2005 21:23:17 -0000 1.21 --- SQLErrorCodeSQLExceptionTranslator.java 21 Apr 2006 19:39:56 -0000 1.21.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 65,68 **** --- 65,69 ---- + /** Logger available to subclasses */ protected final Log logger = LogFactory.getLog(getClass()); *************** *** 367,371 **** } } ! catch (Exception ex) { if (logger.isWarnEnabled()) { logger.warn("Unable to instantiate custom exception class [" + exceptionClass.getName() + "]", ex); --- 368,372 ---- } } ! catch (Throwable ex) { if (logger.isWarnEnabled()) { logger.warn("Unable to instantiate custom exception class [" + exceptionClass.getName() + "]", ex); *************** *** 378,383 **** if (logger.isDebugEnabled()) { String intro = custom ? "Custom translation of" : "Translating"; ! logger.debug(intro + " SQLException with SQLState '" + sqlEx.getSQLState() + ! "' and errorCode '" + sqlEx.getErrorCode() + "' and message [" + sqlEx.getMessage() + "]; SQL was [" + sql + "] for task [" + task + "]"); } --- 379,384 ---- if (logger.isDebugEnabled()) { String intro = custom ? "Custom translation of" : "Translating"; ! logger.debug(intro + " SQLException with SQL state '" + sqlEx.getSQLState() + ! "', error code '" + sqlEx.getErrorCode() + "', message [" + sqlEx.getMessage() + "]; SQL was [" + sql + "] for task [" + task + "]"); } Index: GeneratedKeyHolder.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/support/GeneratedKeyHolder.java,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** GeneratedKeyHolder.java 26 Mar 2005 20:14:16 -0000 1.5 --- GeneratedKeyHolder.java 21 Apr 2006 19:39:56 -0000 1.5.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 41,44 **** --- 41,45 ---- private final List keyList; + /** * Create a new GeneratedKeyHolder with a default list. *************** *** 56,59 **** --- 57,61 ---- } + public Number getKey() throws InvalidDataAccessApiUsageException, DataRetrievalFailureException { if (this.keyList.size() == 0) { |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:31
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/jdbc/core Modified Files: Tag: mbranch-1-2 JdbcOperations.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: JdbcOperations.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/JdbcOperations.java,v retrieving revision 1.32 retrieving revision 1.32.4.1 diff -C2 -d -r1.32 -r1.32.4.1 *** JdbcOperations.java 12 Sep 2005 20:35:30 -0000 1.32 --- JdbcOperations.java 21 Apr 2006 19:39:56 -0000 1.32.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 92,101 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>query</code> method with null as argument array. * @param sql SQL query to execute * @param rse object that will extract all rows of results * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, PreparedStatementSetter, ResultSetExtractor) */ Object query(String sql, ResultSetExtractor rse) throws DataAccessException; --- 92,101 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>query</code> method with <code>null</code> as argument array. * @param sql SQL query to execute * @param rse object that will extract all rows of results * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, Object[], ResultSetExtractor) */ Object query(String sql, ResultSetExtractor rse) throws DataAccessException; *************** *** 107,117 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>query</code> method with null as argument array. * @param sql SQL query to execute ! * @param rch object that will extract results (potentially a ResultReader), ! * one row at a time * @return the result List in case of a ResultReader, or <code>null</code> else * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, PreparedStatementSetter, RowCallbackHandler) * @see ResultReader */ --- 107,116 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>query</code> method with <code>null</code> as argument array. * @param sql SQL query to execute ! * @param rch object that will extract results, one row at a time * @return the result List in case of a ResultReader, or <code>null</code> else * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, Object[], RowCallbackHandler) * @see ResultReader */ *************** *** 123,132 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>query</code> method with null as argument array. * @param sql SQL query to execute * @param rowMapper object that will map one object per row * @return the result List, containing mapped objects * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, PreparedStatementSetter, RowCallbackHandler) */ List query(String sql, RowMapper rowMapper) throws DataAccessException; --- 122,131 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>query</code> method with <code>null</code> as argument array. * @param sql SQL query to execute * @param rowMapper object that will map one object per row * @return the result List, containing mapped objects * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, Object[], RowMapper) */ List query(String sql, RowMapper rowMapper) throws DataAccessException; *************** *** 137,141 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForObject</code> method with null as argument array. * @param sql SQL query to execute * @param rowMapper object that will map one object per row --- 136,140 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForObject</code> method with <code>null</code> as argument array. * @param sql SQL query to execute * @param rowMapper object that will map one object per row *************** *** 144,148 **** * return exactly one row * @throws DataAccessException if there is any problem executing the query ! * @see #query(String, PreparedStatementSetter, RowCallbackHandler) */ Object queryForObject(String sql, RowMapper rowMapper) throws DataAccessException; --- 143,147 ---- * return exactly one row * @throws DataAccessException if there is any problem executing the query ! * @see #queryForObject(String, Object[], RowMapper) */ Object queryForObject(String sql, RowMapper rowMapper) throws DataAccessException; *************** *** 152,156 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForObject</code> method with null as argument array. * <p>This method is useful for running static SQL with a known outcome. * The query is expected to be a single row/single column query; the returned --- 151,155 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForObject</code> method with <code>null</code> as argument array. * <p>This method is useful for running static SQL with a known outcome. * The query is expected to be a single row/single column query; the returned *************** *** 170,174 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForMap</code> method with null as argument array. * <p>The query is expected to be a single row query; the result row will be * mapped to a Map (one entry for each column, using the column name as the key). --- 169,173 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForMap</code> method with <code>null</code> as argument array. * <p>The query is expected to be a single row query; the result row will be * mapped to a Map (one entry for each column, using the column name as the key). *************** *** 188,192 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForLong</code> method with null as argument array. * <p>This method is useful for running static SQL with a known outcome. * The query is expected to be a single row/single column query that results --- 187,191 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForLong</code> method with <code>null</code> as argument array. * <p>This method is useful for running static SQL with a known outcome. * The query is expected to be a single row/single column query that results *************** *** 205,209 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForInt</code> method with null as argument array. * <p>This method is useful for running static SQL with a known outcome. * The query is expected to be a single row/single column query that results --- 204,208 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForInt</code> method with <code>null</code> as argument array. * <p>This method is useful for running static SQL with a known outcome. * The query is expected to be a single row/single column query that results *************** *** 222,226 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForList</code> method with null as argument array. * <p>The results will be mapped to a List (one entry for each row) of * result objects, each of them matching the specified element type. --- 221,225 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForList</code> method with <code>null</code> as argument array. * <p>The results will be mapped to a List (one entry for each row) of * result objects, each of them matching the specified element type. *************** *** 239,243 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForList</code> method with null as argument array. * <p>The results will be mapped to a List (one entry for each row) of * Maps (one entry for each column using the column name as the key). --- 238,242 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForList</code> method with <code>null</code> as argument array. * <p>The results will be mapped to a List (one entry for each row) of * Maps (one entry for each column using the column name as the key). *************** *** 255,259 **** * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForRowSet</code> method with null as argument array. * <p>The results will be mapped to an SqlRowSet which holds the data in a * disconnected fashion. This wrapper will translate any SQLExceptions thrown. --- 254,258 ---- * <p>Uses a JDBC Statement, not a PreparedStatement. If you want to * execute a static query with a PreparedStatement, use the overloaded ! * <code>queryForRowSet</code> method with <code>null</code> as argument array. * <p>The results will be mapped to an SqlRowSet which holds the data in a * disconnected fashion. This wrapper will translate any SQLExceptions thrown. *************** *** 324,340 **** * @throws DataAccessException if there is any problem */ ! Object execute(String sql, PreparedStatementCallback action) ! throws DataAccessException; /** * Query using a prepared statement, reading the ResultSet with a * ResultSetExtractor. * @param psc object that can create a PreparedStatement given a Connection * @param rse object that will extract results * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if there is any problem */ ! Object query(PreparedStatementCreator psc, ResultSetExtractor rse) ! throws DataAccessException; /** --- 323,340 ---- * @throws DataAccessException if there is any problem */ ! Object execute(String sql, PreparedStatementCallback action) throws DataAccessException; /** * Query using a prepared statement, reading the ResultSet with a * ResultSetExtractor. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param rse object that will extract results * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if there is any problem + * @see PreparedStatementCreatorFactory */ ! Object query(PreparedStatementCreator psc, ResultSetExtractor rse) throws DataAccessException; /** *************** *** 343,347 **** * @param sql SQL query to execute * @param pss object that knows how to set values on the prepared statement. ! * If this is null, the SQL will be assumed to contain no bind parameters. * Even if there are no bind parameters, this object may be used to * set fetch size and other performance options. --- 343,347 ---- * @param sql SQL query to execute * @param pss object that knows how to set values on the prepared statement. ! * If this is <code>null</code>, the SQL will be assumed to contain no bind parameters. * Even if there are no bind parameters, this object may be used to * set fetch size and other performance options. *************** *** 385,389 **** * Query using a prepared statement, reading the ResultSet on a per-row * basis with a RowCallbackHandler (potentially implementing the ResultReader ! * sub-interface that provides a result List). * @param psc object that can create a PreparedStatement given a Connection * @param rch object that will extract results (potentially a ResultReader), --- 385,390 ---- * Query using a prepared statement, reading the ResultSet on a per-row * basis with a RowCallbackHandler (potentially implementing the ResultReader ! * <p>A PreparedStatementCreator can either be implemented directly or ! * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param rch object that will extract results (potentially a ResultReader), *************** *** 391,395 **** * @return the result List in case of a ResultReader, or <code>null</code> else * @throws DataAccessException if there is any problem ! * @see ResultReader */ List query(PreparedStatementCreator psc, RowCallbackHandler rch) throws DataAccessException; --- 392,396 ---- * @return the result List in case of a ResultReader, or <code>null</code> else * @throws DataAccessException if there is any problem ! * @see PreparedStatementCreatorFactory */ List query(PreparedStatementCreator psc, RowCallbackHandler rch) throws DataAccessException; *************** *** 403,407 **** * @param sql SQL query to execute * @param pss object that knows how to set values on the prepared statement. ! * If this is null, the SQL will be assumed to contain no bind parameters. * Even if there are no bind parameters, this object may be used to * set fetch size and other performance options. --- 404,408 ---- * @param sql SQL query to execute * @param pss object that knows how to set values on the prepared statement. ! * If this is <code>null</code>, the SQL will be assumed to contain no bind parameters. * Even if there are no bind parameters, this object may be used to * set fetch size and other performance options. *************** *** 453,460 **** --- 454,464 ---- * Query using a prepared statement, mapping each row to a Java object * via a RowMapper. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param rowMapper object that will map one object per row * @return the result List, containing mapped objects * @throws DataAccessException if there is any problem + * @see PreparedStatementCreatorFactory */ List query(PreparedStatementCreator psc, RowMapper rowMapper) throws DataAccessException; *************** *** 466,470 **** * @param sql SQL query to execute * @param pss object that knows how to set values on the prepared statement. ! * If this is null, the SQL will be assumed to contain no bind parameters. * Even if there are no bind parameters, this object may be used to * set fetch size and other performance options. --- 470,474 ---- * @param sql SQL query to execute * @param pss object that knows how to set values on the prepared statement. ! * If this is <code>null</code>, the SQL will be assumed to contain no bind parameters. * Even if there are no bind parameters, this object may be used to * set fetch size and other performance options. *************** *** 474,478 **** */ List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper) ! throws DataAccessException; /** --- 478,482 ---- */ List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper) ! throws DataAccessException; /** *************** *** 574,579 **** * @see #queryForObject(String, Class) */ ! Object queryForObject(String sql, Object[] args, Class requiredType) ! throws DataAccessException; /** --- 578,582 ---- * @see #queryForObject(String, Class) */ ! Object queryForObject(String sql, Object[] args, Class requiredType) throws DataAccessException; /** *************** *** 805,811 **** --- 808,817 ---- * Issue an update using a PreparedStatementCreator to provide SQL and any * required parameters. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that provides SQL and any necessary parameters * @return the number of rows affected * @throws DataAccessException if there is any problem issuing the update + * @see PreparedStatementCreatorFactory */ int update(PreparedStatementCreator psc) throws DataAccessException; *************** *** 813,821 **** /** * Issue an update using a PreparedStatementCreator to provide SQL and any ! * required parameters. Generetaed keys will to be returned by the List parameter. * @param psc object that provides SQL and any necessary parameters * @param generatedKeyHolder KeyHolder that will hold the generated keys * @return the number of rows affected * @throws DataAccessException if there is any problem issuing the update */ int update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) throws DataAccessException; --- 819,832 ---- /** * Issue an update using a PreparedStatementCreator to provide SQL and any ! * required parameters. Generated keys will be put into the given KeyHolder. ! * <p>Note that the given PreparedStatementCreator has to create a statement ! * with activated extraction of generated keys (a JDBC 3.0 feature). This can ! * either be done directly or through using a PreparedStatementCreatorFactory. * @param psc object that provides SQL and any necessary parameters * @param generatedKeyHolder KeyHolder that will hold the generated keys * @return the number of rows affected * @throws DataAccessException if there is any problem issuing the update + * @see PreparedStatementCreatorFactory + * @see org.springframework.jdbc.support.GeneratedKeyHolder */ int update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) throws DataAccessException; *************** *** 826,831 **** * method will create the PreparedStatement: The PreparedStatementSetter * just needs to set parameters. ! * @param sql SQL, containing bind parameters ! * @param pss helper that sets bind parameters. If this is null * we run an update with static SQL. * @return the number of rows affected --- 837,842 ---- * method will create the PreparedStatement: The PreparedStatementSetter * just needs to set parameters. ! * @param sql SQL containing bind parameters ! * @param pss helper that sets bind parameters. If this is <code>null</code> * we run an update with static SQL. * @return the number of rows affected *************** *** 836,840 **** /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters * @param args arguments to bind to the query * @param argTypes SQL types of the arguments --- 847,851 ---- /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL containing bind parameters * @param args arguments to bind to the query * @param argTypes SQL types of the arguments *************** *** 848,852 **** /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters * @param args arguments to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type) --- 859,863 ---- /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL containing bind parameters * @param args arguments to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type) *************** *** 868,873 **** * @throws DataAccessException if there is any problem issuing the update */ ! int[] batchUpdate(String sql, BatchPreparedStatementSetter pss) ! throws DataAccessException; --- 879,883 ---- * @throws DataAccessException if there is any problem issuing the update */ ! int[] batchUpdate(String sql, BatchPreparedStatementSetter pss) throws DataAccessException; *************** *** 905,910 **** * @throws DataAccessException if there is any problem */ ! Object execute(String callString, CallableStatementCallback action) ! throws DataAccessException; /** --- 915,919 ---- * @throws DataAccessException if there is any problem */ ! Object execute(String callString, CallableStatementCallback action) throws DataAccessException; /** *************** *** 916,921 **** * @throws DataAccessException if there is any problem issuing the update */ ! Map call(CallableStatementCreator csc, List declaredParameters) ! throws DataAccessException; } --- 925,929 ---- * @throws DataAccessException if there is any problem issuing the update */ ! Map call(CallableStatementCreator csc, List declaredParameters) throws DataAccessException; } |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:31
|
Update of /cvsroot/springframework/spring/src/org/springframework/beans/factory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/beans/factory Modified Files: Tag: mbranch-1-2 BeanFactory.java FactoryBean.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: BeanFactory.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/BeanFactory.java,v retrieving revision 1.16.4.1 retrieving revision 1.16.4.2 diff -C2 -d -r1.16.4.1 -r1.16.4.2 *** BeanFactory.java 18 Feb 2006 18:58:57 -0000 1.16.4.1 --- BeanFactory.java 21 Apr 2006 19:39:56 -0000 1.16.4.2 *************** *** 108,112 **** * Used to dereference a FactoryBean and distinguish it from beans * <i>created</i> by the FactoryBean. For example, if the bean named ! * <code>myBean</code> is a FactoryBean, getting <code>&myBean</code> will * return the factory, not the instance returned by the factory. */ --- 108,112 ---- * Used to dereference a FactoryBean and distinguish it from beans * <i>created</i> by the FactoryBean. For example, if the bean named ! * <code>myEjb</code> is a FactoryBean, getting <code>&myEjb</code> will * return the factory, not the instance returned by the factory. */ *************** *** 116,121 **** /** * Return an instance, which may be shared or independent, of the given bean name. ! * This method allows a Spring bean factory to be used as a replacement for ! * the Singleton or Prototype design pattern. * <p>Translates aliases back to the corresponding canonical bean name. * Will ask the parent factory if the bean cannot be found in this factory instance. --- 116,122 ---- /** * Return an instance, which may be shared or independent, of the given bean name. ! * This method allows a Spring BeanFactory to be used as a replacement for the ! * Singleton or Prototype design pattern. ! * <p>Callers may retain references to returned objects in the case of Singleton beans. * <p>Translates aliases back to the corresponding canonical bean name. * Will ask the parent factory if the bean cannot be found in this factory instance. *************** *** 130,141 **** /** * Return an instance (possibly shared or independent) of the given bean name. ! * <p>Behaves the same as <code>getBean(String)</code>, but provides a measure of ! * type safety by throwing a Spring BeansException if the bean is not of the required type. * This means that ClassCastException can't be thrown on casting the result correctly, * as can happen with <code>getBean(String)</code>. * @param name the name of the bean to return * @param requiredType type the bean must match. Can be an interface or superclass ! * of the actual class, or <code>null</code> for any match. For example, if the value is ! * Object.class, this method will succeed whatever the class of the returned instance. * @return an instance of the bean (never <code>null</code>) * @throws BeanNotOfRequiredTypeException if the bean is not of the required type --- 131,143 ---- /** * Return an instance (possibly shared or independent) of the given bean name. ! * <p>Behaves the same as getBean(String), but provides a measure of type safety by ! * throwing a Spring BeansException if the bean is not of the required type. * This means that ClassCastException can't be thrown on casting the result correctly, * as can happen with <code>getBean(String)</code>. * @param name the name of the bean to return * @param requiredType type the bean must match. Can be an interface or superclass ! * of the actual class, or <code>null</code> for any match. For example, if the value ! * is <code>Object.class</code>, this method will succeed whatever the class of the ! * returned instance. * @return an instance of the bean (never <code>null</code>) * @throws BeanNotOfRequiredTypeException if the bean is not of the required type *************** *** 147,152 **** /** * Does this bean factory contain a bean definition with the given name? ! * <p>Translates aliases back to the corresponding canonical bean name. ! * Will ask the parent factory if the bean cannot be found in this factory instance. * @param name the name of the bean to query * @return whether a bean with the given name is defined --- 149,153 ---- /** * Does this bean factory contain a bean definition with the given name? ! * <p>Will ask the parent factory if the bean cannot be found in this factory instance. * @param name the name of the bean to query * @return whether a bean with the given name is defined *************** *** 156,164 **** /** * Is this bean a singleton? That is, will <code>getBean</code> always return the same object? ! * <p>Translates aliases back to the corresponding canonical bean name. ! * Will ask the parent factory if the bean cannot be found in this factory instance. * @param name the name of the bean to query * @return is this bean a singleton * @throws NoSuchBeanDefinitionException if there is no bean with the given name */ boolean isSingleton(String name) throws NoSuchBeanDefinitionException; --- 157,165 ---- /** * Is this bean a singleton? That is, will <code>getBean</code> always return the same object? ! * <p>Will ask the parent factory if the bean cannot be found in this factory instance. * @param name the name of the bean to query * @return is this bean a singleton * @throws NoSuchBeanDefinitionException if there is no bean with the given name + * @see #getBean */ boolean isSingleton(String name) throws NoSuchBeanDefinitionException; *************** *** 168,173 **** * More specifically, checks the type of object that <code>getBean</code> would return. * For a FactoryBean, returns the type of object that the FactoryBean creates. - * <p>Translates aliases back to the corresponding canonical bean name. - * Will ask the parent factory if the bean cannot be found in this factory instance. * @param name the name of the bean to query * @return the type of the bean, or <code>null</code> if not determinable --- 169,172 ---- Index: FactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/beans/factory/FactoryBean.java,v retrieving revision 1.15.4.1 retrieving revision 1.15.4.2 diff -C2 -d -r1.15.4.1 -r1.15.4.2 *** FactoryBean.java 21 Feb 2006 18:19:39 -0000 1.15.4.1 --- FactoryBean.java 21 Apr 2006 19:39:56 -0000 1.15.4.2 *************** *** 80,88 **** /** * Is the bean managed by this factory a singleton or a prototype? ! * That is, will getObject() always return the same object? * <p>The singleton status of the FactoryBean itself will generally * be provided by the owning BeanFactory; usually, it has to be * defined as singleton there. * @return if this bean is a singleton */ boolean isSingleton(); --- 80,94 ---- /** * Is the bean managed by this factory a singleton or a prototype? ! * That is, will <code>getObject()</code> always return the same object ! * (a reference that can be cached)? ! * <p><b>NOTE:</b> If a FactoryBean indicates to hold a singleton object, ! * the object returned from <code>getObject()</code> might get cached ! * by the owning BeanFactory. Hence, do not return <code>true</code> ! * unless the FactoryBean always exposes the same reference. * <p>The singleton status of the FactoryBean itself will generally * be provided by the owning BeanFactory; usually, it has to be * defined as singleton there. * @return if this bean is a singleton + * @see #getObject() */ boolean isSingleton(); |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:31
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/object In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/jdbc/object Modified Files: Tag: mbranch-1-2 RdbmsOperation.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: RdbmsOperation.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/object/RdbmsOperation.java,v retrieving revision 1.23 retrieving revision 1.23.4.1 diff -C2 -d -r1.23 -r1.23.4.1 *** RdbmsOperation.java 20 Sep 2005 03:43:54 -0000 1.23 --- RdbmsOperation.java 21 Apr 2006 19:39:56 -0000 1.23.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 46,57 **** * * <p>This class and subclasses throw runtime exceptions, defined in the ! * org.springframework.dao package (and as thrown by the org.springframework.jdbc.core ! * package, which the classes in this package use to perform raw JDBC actions). * * <p>Subclasses should set SQL and add parameters before invoking the ! * compile() method. The order in which parameters are added is significant. ! * The appropriate execute or update method can then be invoked. * * @author Rod Johnson * @see #compile * @see org.springframework.dao --- 46,60 ---- * * <p>This class and subclasses throw runtime exceptions, defined in the ! * <codeorg.springframework.dao package</code> (and as thrown by the ! * <code>org.springframework.jdbc.core</code> package, which the classes ! * in this package use under the hood to perform raw JDBC operations). * * <p>Subclasses should set SQL and add parameters before invoking the ! * <code>compile()</code> method. The order in which parameters are added is ! * significant. The appropriate <code>execute</code> or <code>update</code> ! * method can then be invoked. * * @author Rod Johnson + * @author Juergen Hoeller * @see #compile * @see org.springframework.dao *************** *** 377,382 **** } else { ! // no parameters were supplied ! if (!this.declaredParameters.isEmpty()) { throw new InvalidDataAccessApiUsageException( this.declaredParameters.size() + " parameters must be supplied"); --- 380,385 ---- } else { ! // No parameters were supplied. ! if (this.declaredParameters != null && !this.declaredParameters.isEmpty()) { throw new InvalidDataAccessApiUsageException( this.declaredParameters.size() + " parameters must be supplied"); |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:12
|
Update of /cvsroot/springframework/spring/test/org/springframework/orm/hibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/test/org/springframework/orm/hibernate Modified Files: Tag: mbranch-1-2 HibernateJtaTransactionTests.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: HibernateJtaTransactionTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/orm/hibernate/HibernateJtaTransactionTests.java,v retrieving revision 1.24.2.1 retrieving revision 1.24.2.2 diff -C2 -d -r1.24.2.1 -r1.24.2.2 *** HibernateJtaTransactionTests.java 23 Dec 2005 13:52:05 -0000 1.24.2.1 --- HibernateJtaTransactionTests.java 21 Apr 2006 19:40:00 -0000 1.24.2.2 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 695,700 **** MockControl tmControl = MockControl.createControl(TransactionManager.class); TransactionManager tm = (TransactionManager) tmControl.getMock(); - MockControl tx1Control = MockControl.createControl(javax.transaction.Transaction.class); - javax.transaction.Transaction tx1 = (javax.transaction.Transaction) tx1Control.getMock(); MockControl sfControl = MockControl.createControl(SessionFactory.class); final SessionFactory sf = (SessionFactory) sfControl.getMock(); --- 695,698 ---- *************** *** 710,716 **** ut.begin(); utControl.setVoidCallable(2); tm.suspend(); ! tmControl.setReturnValue(tx1, 1); ! tm.resume(tx1); tmControl.setVoidCallable(1); if (rollback) { --- 708,715 ---- ut.begin(); utControl.setVoidCallable(2); + MockJtaTransaction transaction = new MockJtaTransaction(); tm.suspend(); ! tmControl.setReturnValue(transaction, 1); ! tm.resume(transaction); tmControl.setVoidCallable(1); if (rollback) { |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:12
|
Update of /cvsroot/springframework/spring/test/org/springframework/orm/jdo/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/test/org/springframework/orm/jdo/support Modified Files: Tag: mbranch-1-2 OpenPersistenceManagerInViewTests.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: OpenPersistenceManagerInViewTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/orm/jdo/support/OpenPersistenceManagerInViewTests.java,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** OpenPersistenceManagerInViewTests.java 25 Mar 2005 09:28:34 -0000 1.4 --- OpenPersistenceManagerInViewTests.java 21 Apr 2006 19:40:00 -0000 1.4.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 145,150 **** final FilterChain filterChain = new FilterChain() { ! public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse) ! throws IOException, ServletException { assertTrue(TransactionSynchronizationManager.hasResource(pmf)); servletRequest.setAttribute("invoked", Boolean.TRUE); --- 145,149 ---- final FilterChain filterChain = new FilterChain() { ! public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse) { assertTrue(TransactionSynchronizationManager.hasResource(pmf)); servletRequest.setAttribute("invoked", Boolean.TRUE); |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:12
|
Update of /cvsroot/springframework/spring/test/org/springframework/beans/factory/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/test/org/springframework/beans/factory/xml Modified Files: Tag: mbranch-1-2 XmlBeanFactoryTests.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: XmlBeanFactoryTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/beans/factory/xml/XmlBeanFactoryTests.java,v retrieving revision 1.31.2.1 retrieving revision 1.31.2.2 diff -C2 -d -r1.31.2.1 -r1.31.2.2 *** XmlBeanFactoryTests.java 17 Jan 2006 21:29:36 -0000 1.31.2.1 --- XmlBeanFactoryTests.java 21 Apr 2006 19:40:00 -0000 1.31.2.2 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:11
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/web/filter Modified Files: Tag: mbranch-1-2 GenericFilterBean.java OncePerRequestFilter.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: GenericFilterBean.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/filter/GenericFilterBean.java,v retrieving revision 1.8.4.1 retrieving revision 1.8.4.2 diff -C2 -d -r1.8.4.1 -r1.8.4.2 *** GenericFilterBean.java 23 Dec 2005 13:52:04 -0000 1.8.4.1 --- GenericFilterBean.java 21 Apr 2006 19:39:59 -0000 1.8.4.2 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 32,43 **** import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeansException; - import org.springframework.beans.FatalBeanException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValues; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceEditor; import org.springframework.core.io.ResourceLoader; import org.springframework.util.StringUtils; import org.springframework.web.context.support.ServletContextResourceLoader; import org.springframework.web.util.NestedServletException; --- 32,48 ---- import org.springframework.beans.BeanWrapperImpl; import org.springframework.beans.BeansException; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValues; + import org.springframework.beans.factory.BeanInitializationException; + import org.springframework.beans.factory.BeanNameAware; + import org.springframework.beans.factory.DisposableBean; + import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceEditor; import org.springframework.core.io.ResourceLoader; + import org.springframework.util.Assert; import org.springframework.util.StringUtils; + import org.springframework.web.context.ServletContextAware; import org.springframework.web.context.support.ServletContextResourceLoader; import org.springframework.web.util.NestedServletException; *************** *** 64,68 **** * @see org.springframework.web.context.support.WebApplicationContextUtils#getWebApplicationContext */ ! public abstract class GenericFilterBean implements Filter { /** Logger available to subclasses */ --- 69,74 ---- * @see org.springframework.web.context.support.WebApplicationContextUtils#getWebApplicationContext */ ! public abstract class GenericFilterBean implements ! Filter, BeanNameAware, ServletContextAware, InitializingBean, DisposableBean { /** Logger available to subclasses */ *************** *** 79,87 **** /** * Subclasses can invoke this method to specify that this property * (which must match a JavaBean property they expose) is mandatory, * and must be supplied as a config parameter. This should be called ! * from the constructor of a subclass * @param property name of the required property */ --- 85,135 ---- + private String beanName; + + private ServletContext servletContext; + + + /** + * Stores the bean name as defined in the Spring bean factory. + * <p>Only relevant in case of initialization as bean, to have a name as + * fallback to the filter name usually provided by a FilterConfig instance. + * @see org.springframework.beans.factory.BeanNameAware + * @see #getFilterName() + */ + public final void setBeanName(String beanName) { + this.beanName = beanName; + } + + /** + * Stores the ServletContext that the bean factory runs in. + * <p>Only relevant in case of initialization as bean, to have a ServletContext + * as fallback to the context usually provided by a FilterConfig instance. + * @see org.springframework.web.context.ServletContextAware + * @see #getServletContext() + */ + public final void setServletContext(ServletContext servletContext) { + this.servletContext = servletContext; + } + + /** + * Calls the <code>initFilterBean()</code> method that might + * contain custom initialization of a subclass. + * <p>Only relevant in case of initialization as bean, where the + * standard <code>init(FilterConfig)</code> method won't be called. + * @see #initFilterBean() + * @see #init(javax.servlet.FilterConfig) + */ + public void afterPropertiesSet() throws ServletException { + initFilterBean(); + } + + /** * Subclasses can invoke this method to specify that this property * (which must match a JavaBean property they expose) is mandatory, * and must be supplied as a config parameter. This should be called ! * from the constructor of a subclass. ! * <p>This method is only relevant in case of traditional initialization ! * driven by a FilterConfig instance. * @param property name of the required property */ *************** *** 91,111 **** /** ! * Alternative way of initializing this filter. ! * Used by Servlet Filter version that shipped with WebLogic 6.1. ! * @param filterConfig the configuration for this filter ! * @throws FatalBeanException wrapping a ServletException ! * thrown by the init method ! * @see #init ! */ ! public final void setFilterConfig(FilterConfig filterConfig) { ! try { ! init(filterConfig); ! } ! catch (ServletException ex) { ! throw new FatalBeanException("Couldn't initialize filter bean", ex); ! } ! } ! ! /** * Map config parameters onto bean properties of this filter, and * invoke subclass initialization. --- 139,143 ---- /** ! * Standard way of initializing this filter. * Map config parameters onto bean properties of this filter, and * invoke subclass initialization. *************** *** 116,119 **** --- 148,152 ---- */ public final void init(FilterConfig filterConfig) throws ServletException { + Assert.notNull(filterConfig, "FilterConfig must not be null"); if (logger.isInfoEnabled()) { logger.info("Initializing filter '" + filterConfig.getFilterName() + "'"); *************** *** 147,152 **** --- 180,203 ---- /** + * Alternative way of initializing this filter. + * Used by Servlet Filter version that shipped with WebLogic 6.1. + * @param filterConfig the configuration for this filter + * @throws BeanInitializationException wrapping a ServletException + * thrown by the <code>init</code> method + * @see #init(javax.servlet.FilterConfig) + */ + public final void setFilterConfig(FilterConfig filterConfig) { + try { + init(filterConfig); + } + catch (ServletException ex) { + throw new BeanInitializationException("Couldn't initialize filter bean", ex); + } + } + + /** * Initialize the BeanWrapper for this GenericFilterBean, * possibly with custom editors. + * <p>This default implementation is empty. * @param bw the BeanWrapper to initialize * @throws BeansException if thrown by BeanWrapper methods *************** *** 156,165 **** } /** ! * Make the FilterConfig of this filter available. ! * Analogous to GenericServlet's getServletConfig. ! * <p>Public to resemble the getFilterConfig method of the ! * Servlet Filter version that shipped with WebLogic 6.1. ! * @see javax.servlet.GenericServlet#getServletConfig */ public final FilterConfig getFilterConfig() { --- 207,218 ---- } + /** ! * Make the FilterConfig of this filter available, if any. ! * Analogous to GenericServlet's <code>getServletConfig()</code>. ! * <p>Public to resemble the <code>getFilterConfig()</code> method ! * of the Servlet Filter version that shipped with WebLogic 6.1. ! * @return the FilterConfig instance, or <code>null</code> if none available ! * @see javax.servlet.GenericServlet#getServletConfig() */ public final FilterConfig getFilterConfig() { *************** *** 169,193 **** /** * Make the name of this filter available to subclasses. ! * Analogous to GenericServlet's getServletName. ! * @see javax.servlet.GenericServlet#getServletName */ protected final String getFilterName() { ! return this.filterConfig.getFilterName(); } /** * Make the ServletContext of this filter available to subclasses. ! * Analogous to GenericServlet's getServletContext. ! * @see javax.servlet.GenericServlet#getServletContext */ protected final ServletContext getServletContext() { ! return this.filterConfig.getServletContext(); } /** * Subclasses may override this to perform custom initialization. * All bean properties of this filter will have been set before this ! * method is invoked. This default implementation does nothing. * @throws ServletException if subclass initialization fails */ protected void initFilterBean() throws ServletException { --- 222,265 ---- /** * Make the name of this filter available to subclasses. ! * Analogous to GenericServlet's <code>getServletName()</code>. ! * <p>Takes the FilterConfig's filter name by default. ! * If initialized as bean in a Spring application context, ! * it falls back to the bean name as defined in the bean factory. ! * @return the filter name, or <code>null</code> if none available ! * @see javax.servlet.GenericServlet#getServletName() ! * @see javax.servlet.FilterConfig#getFilterName() ! * @see #setBeanName */ protected final String getFilterName() { ! return (this.filterConfig != null ? this.filterConfig.getFilterName() : this.beanName); } /** * Make the ServletContext of this filter available to subclasses. ! * Analogous to GenericServlet's <code>getServletContext()</code>. ! * <p>Takes the FilterConfig's ServletContext by default. ! * If initialized as bean in a Spring application context, ! * it falls back to the ServletContext that the bean factory runs in. ! * @return the ServletContext instance, or <code>null</code> if none available ! * @see javax.servlet.GenericServlet#getServletContext() ! * @see javax.servlet.FilterConfig#getServletContext() ! * @see #setServletContext */ protected final ServletContext getServletContext() { ! return (this.filterConfig != null ? this.filterConfig.getServletContext() : this.servletContext); } + /** * Subclasses may override this to perform custom initialization. * All bean properties of this filter will have been set before this ! * method is invoked. ! * <p>Note: This method will be called from standard filter initialization ! * as well as filter bean initialization in a Spring application context. ! * Filter name and ServletContext will be available in both cases. ! * <p>This default implementation is empty. * @throws ServletException if subclass initialization fails + * @see #getFilterName() + * @see #getServletContext() */ protected void initFilterBean() throws ServletException { *************** *** 196,200 **** /** * Subclasses may override this to perform custom filter shutdown. ! * This default implementation does nothing. */ public void destroy() { --- 268,274 ---- /** * Subclasses may override this to perform custom filter shutdown. ! * <p>Note: This method will be called from standard filter destruction ! * as well as filter bean destruction in a Spring application context. ! * <p>This default implementation is empty. */ public void destroy() { *************** *** 230,234 **** } ! // fail if we are still missing properties if (missingProps != null && missingProps.size() > 0) { throw new ServletException( --- 304,308 ---- } ! // Fail if we are still missing properties. if (missingProps != null && missingProps.size() > 0) { throw new ServletException( Index: OncePerRequestFilter.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/filter/OncePerRequestFilter.java,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** OncePerRequestFilter.java 25 Mar 2005 09:27:55 -0000 1.6 --- OncePerRequestFilter.java 21 Apr 2006 19:40:00 -0000 1.6.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 49,54 **** public static final String ALREADY_FILTERED_SUFFIX = ".FILTERED"; /** ! * This doFilter implementation stores a request attribute for * "already filtered", proceeding without filtering again if the * attribute is already there. --- 49,55 ---- public static final String ALREADY_FILTERED_SUFFIX = ".FILTERED"; + /** ! * This <code>doFilter</code> implementation stores a request attribute for * "already filtered", proceeding without filtering again if the * attribute is already there. *************** *** 68,76 **** String alreadyFilteredAttributeName = getAlreadyFilteredAttributeName(); if (request.getAttribute(alreadyFilteredAttributeName) != null || shouldNotFilter(httpRequest)) { ! // proceed without invoking this filter filterChain.doFilter(request, response); } else { ! // invoke this filter request.setAttribute(alreadyFilteredAttributeName, Boolean.TRUE); doFilterInternal(httpRequest, httpResponse, filterChain); --- 69,77 ---- String alreadyFilteredAttributeName = getAlreadyFilteredAttributeName(); if (request.getAttribute(alreadyFilteredAttributeName) != null || shouldNotFilter(httpRequest)) { ! // Proceed without invoking this filter... filterChain.doFilter(request, response); } else { ! // Do invoke this filter... request.setAttribute(alreadyFilteredAttributeName, Boolean.TRUE); doFilterInternal(httpRequest, httpResponse, filterChain); *************** *** 80,96 **** /** * Return the name of the request attribute that identifies that a request ! * is already filtered. Default implementation takes the configured name ! * of the concrete filter instance and appends ".FILTERED". * @see #getFilterName * @see #ALREADY_FILTERED_SUFFIX */ protected String getAlreadyFilteredAttributeName() { ! return getFilterName() + ALREADY_FILTERED_SUFFIX; } /** ! * Can return true to avoid filtering of the given request. ! * The default implementation always returns false. ! * Can be overridden in subclasses for custom filtering control. * @param request current HTTP request * @return whether the given request should <i>not</i> be filtered --- 81,103 ---- /** * Return the name of the request attribute that identifies that a request ! * is already filtered. ! * <p>Default implementation takes the configured name of the concrete filter ! * instance and appends ".FILTERED". If the filter is not fully initialized, ! * it falls back to its class name. * @see #getFilterName * @see #ALREADY_FILTERED_SUFFIX */ protected String getAlreadyFilteredAttributeName() { ! String name = getFilterName(); ! if (name == null) { ! name = getClass().getName(); ! } ! return name + ALREADY_FILTERED_SUFFIX; } /** ! * Can be overridden in subclasses for custom filtering control, ! * returning <code>true</code> to avoid filtering of the given request. ! * <p>The default implementation always returns <code>false</code>. * @param request current HTTP request * @return whether the given request should <i>not</i> be filtered *************** *** 101,104 **** --- 108,112 ---- } + /** * Same contract as for doFilter, but guaranteed to be just invoked once per |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:10
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/servlet/mvc/multiaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/web/servlet/mvc/multiaction Modified Files: Tag: mbranch-1-2 MethodNameResolver.java NoSuchRequestHandlingMethodException.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: MethodNameResolver.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/servlet/mvc/multiaction/MethodNameResolver.java,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** MethodNameResolver.java 25 Mar 2005 09:27:58 -0000 1.6 --- MethodNameResolver.java 21 Apr 2006 19:40:00 -0000 1.6.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 37,43 **** * @param request current HTTP request * @return a method name that can handle this request. ! * Never returns null; throws exception if not resolvable. ! * @throws NoSuchRequestHandlingMethodException if no method ! * can be found for this URL */ String getHandlerMethodName(HttpServletRequest request) throws NoSuchRequestHandlingMethodException; --- 37,43 ---- * @param request current HTTP request * @return a method name that can handle this request. ! * Never returns <code>null</code>; throws exception if not resolvable. ! * @throws NoSuchRequestHandlingMethodException if no handler method ! * can be found for the given request */ String getHandlerMethodName(HttpServletRequest request) throws NoSuchRequestHandlingMethodException; Index: NoSuchRequestHandlingMethodException.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/servlet/mvc/multiaction/NoSuchRequestHandlingMethodException.java,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** NoSuchRequestHandlingMethodException.java 27 May 2005 19:50:17 -0000 1.5 --- NoSuchRequestHandlingMethodException.java 21 Apr 2006 19:40:00 -0000 1.5.4.1 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 24,36 **** * * @author Rod Johnson */ public class NoSuchRequestHandlingMethodException extends ServletException { ! public NoSuchRequestHandlingMethodException(HttpServletRequest request) { super("No handling method can be found for request [" + request + "]"); } ! public NoSuchRequestHandlingMethodException(String name, Class controllerClass) { ! super("No request handling method with name '" + name + "' in class '" + controllerClass.getName() + "'"); } --- 24,59 ---- * * @author Rod Johnson + * @author Juergen Hoeller */ public class NoSuchRequestHandlingMethodException extends ServletException { ! ! private String methodName; ! ! ! /** ! * Create a new NoSuchRequestHandlingMethodException for the given request. ! * @param request the offending HTTP request ! */ public NoSuchRequestHandlingMethodException(HttpServletRequest request) { super("No handling method can be found for request [" + request + "]"); } ! /** ! * Create a new NoSuchRequestHandlingMethodException for the given request. ! * @param methodName the name of the handler method that wasn't found ! * @param controllerClass the class the handler method was expected to be in ! */ ! public NoSuchRequestHandlingMethodException(String methodName, Class controllerClass) { ! super("No request handling method with name '" + methodName + ! "' in class [" + controllerClass.getName() + "]"); ! this.methodName = methodName; ! } ! ! ! /** ! * Return the name of the offending method, if known. ! */ ! public String getMethodName() { ! return methodName; } |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:10
|
Update of /cvsroot/springframework/spring/test/org/springframework/web/servlet/handler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/test/org/springframework/web/servlet/handler Modified Files: Tag: mbranch-1-2 SimpleMappingExceptionResolverTests.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: SimpleMappingExceptionResolverTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/web/servlet/handler/SimpleMappingExceptionResolverTests.java,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** SimpleMappingExceptionResolverTests.java 24 Jul 2005 21:24:57 -0000 1.1 --- SimpleMappingExceptionResolverTests.java 21 Apr 2006 19:40:01 -0000 1.1.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 27,33 **** --- 27,35 ---- import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.web.servlet.ModelAndView; + import org.springframework.web.util.UrlPathHelper; /** * @author Seth Ladd + * @author Juergen Hoeller */ public class SimpleMappingExceptionResolverTests extends TestCase { *************** *** 87,91 **** exceptionResolver.setDefaultErrorView("default-view"); ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, genericException); ! assertEquals(200, response.getStatus()); } --- 89,93 ---- exceptionResolver.setDefaultErrorView("default-view"); ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, genericException); ! assertEquals(HttpServletResponse.SC_OK, response.getStatus()); } *************** *** 97,100 **** --- 99,110 ---- } + public void testNoDefaultStatusCodeInInclude() { + exceptionResolver.setDefaultErrorView("default-view"); + exceptionResolver.setDefaultStatusCode(HttpServletResponse.SC_BAD_REQUEST); + request.setAttribute(UrlPathHelper.INCLUDE_URI_REQUEST_ATTRIBUTE, "some path"); + ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, genericException); + assertEquals(HttpServletResponse.SC_OK, response.getStatus()); + } + public void testSimpleExceptionMapping() { Properties props = new Properties(); *************** *** 174,186 **** public void testThreeMappings() { ! Exception oddException = new AnotherSomeOddException(); Properties props = new Properties(); props.setProperty("java.lang.Exception", "error"); props.setProperty("SomeOddException", "another-error"); ! props.setProperty("AnotherSomeOddException", "another-some-error"); exceptionResolver.setMappedHandlers(Collections.singleton(handler1)); exceptionResolver.setExceptionMappings(props); ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, oddException); ! assertEquals("another-error", mav.getViewName()); } --- 184,196 ---- public void testThreeMappings() { ! Exception oddException = new AnotherOddException(); Properties props = new Properties(); props.setProperty("java.lang.Exception", "error"); props.setProperty("SomeOddException", "another-error"); ! props.setProperty("AnotherOddException", "another-some-error"); exceptionResolver.setMappedHandlers(Collections.singleton(handler1)); exceptionResolver.setExceptionMappings(props); ModelAndView mav = exceptionResolver.resolveException(request, response, handler1, oddException); ! assertEquals("another-some-error", mav.getViewName()); } *************** *** 191,195 **** ! private static class AnotherSomeOddException extends Exception { } --- 201,205 ---- ! private static class AnotherOddException extends Exception { } |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:08
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/servlet/view/jasperreports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/web/servlet/view/jasperreports Modified Files: Tag: mbranch-1-2 AbstractJasperReportsSingleFormatView.java AbstractJasperReportsView.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: AbstractJasperReportsSingleFormatView.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsSingleFormatView.java,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -C2 -d -r1.10 -r1.10.4.1 *** AbstractJasperReportsSingleFormatView.java 8 Sep 2005 18:35:10 -0000 1.10 --- AbstractJasperReportsSingleFormatView.java 21 Apr 2006 19:40:00 -0000 1.10.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 28,31 **** --- 28,32 ---- import org.springframework.ui.jasperreports.JasperReportsUtils; + import org.springframework.web.util.WebUtils; /** *************** *** 66,79 **** if (useWriter()) { ! // Copy the encoding configured for the report into the response- String encoding = (String) exporter.getParameter(JRExporterParameter.CHARACTER_ENCODING); if (encoding != null) { ! response.setCharacterEncoding(encoding); } ! // Render report into HttpServletResponse's Writer. JasperReportsUtils.render(exporter, populatedReport, response.getWriter()); } else { // Render report into local OutputStream. // IE workaround: write into byte array first. --- 67,93 ---- if (useWriter()) { ! // We need to write text to the response Writer. ! ! // Copy the encoding configured for the report into the response. ! String contentType = getContentType(); String encoding = (String) exporter.getParameter(JRExporterParameter.CHARACTER_ENCODING); if (encoding != null) { ! // Only apply encoding if content type is specified but does not contain charset clause already. ! if (contentType != null && contentType.toLowerCase().indexOf(WebUtils.CONTENT_TYPE_CHARSET_PREFIX) == -1) { ! contentType = contentType + WebUtils.CONTENT_TYPE_CHARSET_PREFIX + encoding; ! } } ! response.setContentType(contentType); ! // Render report into HttpServletResponse's Writer. JasperReportsUtils.render(exporter, populatedReport, response.getWriter()); } + else { + // We need to write binary output to the response OutputStream. + + // Apply the content type as specified - we don't need an encoding here. + response.setContentType(getContentType()); + // Render report into local OutputStream. // IE workaround: write into byte array first. Index: AbstractJasperReportsView.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/servlet/view/jasperreports/AbstractJasperReportsView.java,v retrieving revision 1.35 retrieving revision 1.35.4.1 diff -C2 -d -r1.35 -r1.35.4.1 *** AbstractJasperReportsView.java 17 Sep 2005 17:05:33 -0000 1.35 --- AbstractJasperReportsView.java 21 Apr 2006 19:40:00 -0000 1.35.4.1 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 502,511 **** throws Exception { - response.reset(); - response.setContentType(getContentType()); - - // Populate HTTP headers. - populateHeaders(response); - if (this.subReports != null) { // Expose sub-reports as model attributes. --- 502,505 ---- *************** *** 524,530 **** exposeLocalizationContext(model, request); ! // Fill and render the report. JasperPrint filledReport = fillReport(model); postProcessReport(filledReport, model); renderReport(filledReport, model, response); } --- 518,528 ---- exposeLocalizationContext(model, request); ! // Fill the report. JasperPrint filledReport = fillReport(model); postProcessReport(filledReport, model); + + // Prepare response and render report. + response.reset(); + populateHeaders(response); renderReport(filledReport, model, response); } *************** *** 574,582 **** JRDataSource jrDataSource = getReportData(model); - if (jrDataSource == null && this.jdbcDataSource == null) { - throw new IllegalArgumentException( - "No report data source found in model and no [javax.sql.DataSource] specified in configuration"); - } - if (jrDataSource != null) { // Use the JasperReports JRDataSource. --- 572,575 ---- *************** *** 586,590 **** --- 579,593 ---- return JasperFillManager.fillReport(this.report, model, jrDataSource); } + else { + if (this.jdbcDataSource == null) { + this.jdbcDataSource = (DataSource) CollectionUtils.findValueOfType(model.values(), DataSource.class); + if (this.jdbcDataSource == null) { + throw new IllegalArgumentException( + "No report data source found in model, " + + "and no [javax.sql.DataSource] specified in configuration or in model"); + } + } + // Use the JDBC DataSource. if (logger.isDebugEnabled()) { *************** *** 607,611 **** /** ! * Populates the headers in the <code>HttpServletResponse.</code> with the * headers supplied by the user. */ --- 610,614 ---- /** ! * Populates the headers in the <code>HttpServletResponse</code> with the * headers supplied by the user. */ *************** *** 718,725 **** --- 721,739 ---- /** * Subclasses should implement this method to perform the actual rendering process. + * <p>Note that the content type has not been set yet: Implementors should build + * a content type String and set it via <code>response.setContentType</code>. + * If necessary, this can include a charset clause for a specific encoding. + * The latter will only be necessary for textual output onto a Writer, and only + * in case of the encoding being specified in the JasperReports exporter parameters. + * <p><b>WARNING:</b> Implementors should not use <code>response.setCharacterEncoding</code> + * unless they are willing to depend on Servlet API 2.4 or higher. Prefer a + * concatenated content type String with a charset clause instead. * @param populatedReport the populated <code>JasperPrint</code> to render * @param model the map containing report parameters * @param response the HTTP response the report should be rendered to * @throws Exception if rendering failed + * @see #getContentType() + * @see javax.servlet.ServletResponse#setContentType + * @see javax.servlet.ServletResponse#setCharacterEncoding */ protected abstract void renderReport(JasperPrint populatedReport, Map model, HttpServletResponse response) |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:06
|
Update of /cvsroot/springframework/spring/test/org/springframework/beans/factory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/test/org/springframework/beans/factory Modified Files: Tag: mbranch-1-2 DefaultListableBeanFactoryTests.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: DefaultListableBeanFactoryTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java,v retrieving revision 1.14.4.2 retrieving revision 1.14.4.3 diff -C2 -d -r1.14.4.2 -r1.14.4.3 *** DefaultListableBeanFactoryTests.java 23 Feb 2006 22:55:03 -0000 1.14.4.2 --- DefaultListableBeanFactoryTests.java 21 Apr 2006 19:40:00 -0000 1.14.4.3 *************** *** 426,429 **** --- 426,457 ---- } + public void testRegisterExistingSingletonWithNameOverriding() { + DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); + Properties p = new Properties(); + p.setProperty("test.(class)", "org.springframework.beans.TestBean"); + p.setProperty("test.name", "Tony"); + p.setProperty("test.age", "48"); + p.setProperty("test.spouse(ref)", "singletonObject"); + p.setProperty("singletonObject.(class)", "org.springframework.beans.factory.config.PropertiesFactoryBean"); + (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p); + Object singletonObject = new TestBean(); + lbf.registerSingleton("singletonObject", singletonObject); + lbf.preInstantiateSingletons(); + + assertTrue(lbf.isSingleton("singletonObject")); + assertEquals(TestBean.class, lbf.getType("singletonObject")); + TestBean test = (TestBean) lbf.getBean("test"); + assertEquals(singletonObject, lbf.getBean("singletonObject")); + assertEquals(singletonObject, test.getSpouse()); + + Map beansOfType = lbf.getBeansOfType(TestBean.class, false, true); + assertEquals(2, beansOfType.size()); + assertTrue(beansOfType.containsValue(test)); + assertTrue(beansOfType.containsValue(singletonObject)); + + beansOfType = lbf.getBeansOfType(null, false, true); + assertEquals(2, beansOfType.size()); + } + public void testRegisterExistingSingletonWithAutowire() { DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); *************** *** 479,483 **** lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, true); TestBean spouse = (TestBean) lbf.getBean("spouse"); ! assertEquals(bean.getSpouse(), spouse); assertTrue(BeanFactoryUtils.beanOfType(lbf, TestBean.class) == spouse); } --- 507,511 ---- lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_NAME, true); TestBean spouse = (TestBean) lbf.getBean("spouse"); ! assertEquals(spouse, bean.getSpouse()); assertTrue(BeanFactoryUtils.beanOfType(lbf, TestBean.class) == spouse); } *************** *** 512,516 **** lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true); TestBean test = (TestBean) lbf.getBean("test"); ! assertEquals(bean.getSpouse(), test); } --- 540,544 ---- lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true); TestBean test = (TestBean) lbf.getBean("test"); ! assertEquals(test, bean.getSpouse()); } *************** *** 541,545 **** TestBean spouse = (TestBean) lbf.getBean("spouse"); assertEquals(existingBean.getSpouse(), spouse); ! assertTrue(BeanFactoryUtils.beanOfType(lbf, TestBean.class) == spouse); } --- 569,573 ---- TestBean spouse = (TestBean) lbf.getBean("spouse"); assertEquals(existingBean.getSpouse(), spouse); ! assertSame(spouse, BeanFactoryUtils.beanOfType(lbf, TestBean.class)); } *************** *** 783,787 **** public void testBeanPostProcessorWithWrappedObjectAndDestroyMethod() { DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); ! RootBeanDefinition bd = new RootBeanDefinition(BeanWithDestroyMethod.class, null); bd.setDestroyMethodName("close"); lbf.registerBeanDefinition("test", bd); --- 811,815 ---- public void testBeanPostProcessorWithWrappedObjectAndDestroyMethod() { DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); ! RootBeanDefinition bd = new RootBeanDefinition(BeanWithDestroyMethod.class); bd.setDestroyMethodName("close"); lbf.registerBeanDefinition("test", bd); |
From: Juergen H. <jho...@us...> - 2006-04-21 19:40:05
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7077/src/org/springframework/web/util Modified Files: Tag: mbranch-1-2 WebUtils.java Log Message: backported fixes and enhancements from 2.0 M4 (HEAD) Index: WebUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/util/WebUtils.java,v retrieving revision 1.29.2.2 retrieving revision 1.29.2.3 diff -C2 -d -r1.29.2.2 -r1.29.2.3 *** WebUtils.java 21 Apr 2006 00:13:51 -0000 1.29.2.2 --- WebUtils.java 21 Apr 2006 19:40:00 -0000 1.29.2.3 *************** *** 5,11 **** * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 5,11 ---- * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 43,48 **** /** ! * Default character encoding to use when request.getCharacterEncoding ! * returns null, according to the Servlet spec. * @see ServletRequest#getCharacterEncoding */ --- 43,53 ---- /** ! * Prefix of the charset clause in a content type String: ";charset=" ! */ ! public static final String CONTENT_TYPE_CHARSET_PREFIX = ";charset="; ! ! /** ! * Default character encoding to use when <code>request.getCharacterEncoding</code> ! * returns <code>null</code>, according to the Servlet spec. * @see ServletRequest#getCharacterEncoding */ |
From: Juergen H. <jho...@us...> - 2006-04-21 19:26:33
|
Update of /cvsroot/springframework/spring/src/org/springframework/web/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32106/src/org/springframework/web/util Modified Files: Tag: mbranch-1-2 NestedServletException.java Log Message: stick with classic Spring nested output style for 1.2.x Index: NestedServletException.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/web/util/NestedServletException.java,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** NestedServletException.java 21 Apr 2006 00:13:51 -0000 1.2.4.1 --- NestedServletException.java 21 Apr 2006 19:26:29 -0000 1.2.4.2 *************** *** 94,98 **** else { ps.println(this); - ps.print("Caused by: "); getCause().printStackTrace(ps); } --- 94,97 ---- *************** *** 109,113 **** else { pw.println(this); - pw.print("Caused by: "); getCause().printStackTrace(pw); } --- 108,111 ---- |
From: Juergen H. <jho...@us...> - 2006-04-21 19:26:08
|
Update of /cvsroot/springframework/spring/src/org/springframework/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31675/src/org/springframework/core Modified Files: Tag: mbranch-1-2 NestedCheckedException.java NestedRuntimeException.java Log Message: stick with classic Spring nested output style for 1.2.x Index: NestedCheckedException.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/core/NestedCheckedException.java,v retrieving revision 1.15.4.1 retrieving revision 1.15.4.2 diff -C2 -d -r1.15.4.1 -r1.15.4.2 *** NestedCheckedException.java 21 Apr 2006 00:13:48 -0000 1.15.4.1 --- NestedCheckedException.java 21 Apr 2006 19:25:57 -0000 1.15.4.2 *************** *** 108,112 **** else { ps.println(this); - ps.print("Caused by: "); getCause().printStackTrace(ps); } --- 108,111 ---- *************** *** 123,127 **** else { pw.println(this); - pw.print("Caused by: "); getCause().printStackTrace(pw); } --- 122,125 ---- Index: NestedRuntimeException.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/core/NestedRuntimeException.java,v retrieving revision 1.15.4.1 retrieving revision 1.15.4.2 diff -C2 -d -r1.15.4.1 -r1.15.4.2 *** NestedRuntimeException.java 21 Apr 2006 00:13:48 -0000 1.15.4.1 --- NestedRuntimeException.java 21 Apr 2006 19:25:57 -0000 1.15.4.2 *************** *** 108,112 **** else { ps.println(this); - ps.print("Caused by: "); getCause().printStackTrace(ps); } --- 108,111 ---- *************** *** 123,127 **** else { pw.println(this); - pw.print("Caused by: "); getCause().printStackTrace(pw); } --- 122,125 ---- |
From: Rod J. <joh...@us...> - 2006-04-21 17:03:30
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15236/tiger/src/org/springframework/orm/jpa Modified Files: LocalEntityManagerFactoryBean.java AbstractEntityManagerFactoryBean.java Log Message: Added instantiatePersistenceProvider method Index: LocalEntityManagerFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/LocalEntityManagerFactoryBean.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LocalEntityManagerFactoryBean.java 21 Apr 2006 16:59:37 -0000 1.7 --- LocalEntityManagerFactoryBean.java 21 Apr 2006 17:03:28 -0000 1.8 *************** *** 24,28 **** import javax.persistence.spi.PersistenceProvider; - import org.springframework.beans.BeanUtils; /** --- 24,27 ---- *************** *** 90,94 **** // Create EntityManagerFactory directly through PersistenceProvider. PersistenceProvider pp = ! (PersistenceProvider) BeanUtils.instantiateClass(this.persistenceProviderClass); EntityManagerFactory emf = pp.createEntityManagerFactory(this.entityManagerName, this.jpaProperties); if (emf == null) { --- 89,93 ---- // Create EntityManagerFactory directly through PersistenceProvider. PersistenceProvider pp = ! instantiatePersistenceProvider(); EntityManagerFactory emf = pp.createEntityManagerFactory(this.entityManagerName, this.jpaProperties); if (emf == null) { Index: AbstractEntityManagerFactoryBean.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/AbstractEntityManagerFactoryBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractEntityManagerFactoryBean.java 21 Apr 2006 16:59:37 -0000 1.2 --- AbstractEntityManagerFactoryBean.java 21 Apr 2006 17:03:28 -0000 1.3 *************** *** 23,26 **** --- 23,27 ---- import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; *************** *** 107,109 **** --- 108,118 ---- } + /** + * @return a new instance of the appropriate PersistenceProvider based on the + * persistence provider class + */ + protected PersistenceProvider instantiatePersistenceProvider() { + return (PersistenceProvider) BeanUtils.instantiateClass(this.persistenceProviderClass); + } + } |