You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(55) |
Mar
(100) |
Apr
(203) |
May
(330) |
Jun
(190) |
Jul
(302) |
Aug
(323) |
Sep
(197) |
Oct
(245) |
Nov
(490) |
Dec
(330) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(194) |
Feb
(400) |
Mar
(416) |
Apr
(415) |
May
(359) |
Jun
(381) |
Jul
(491) |
Aug
(311) |
Sep
(291) |
Oct
(273) |
Nov
(355) |
Dec
(266) |
| 2005 |
Jan
(306) |
Feb
(303) |
Mar
(520) |
Apr
(346) |
May
(255) |
Jun
(221) |
Jul
(171) |
Aug
(247) |
Sep
(147) |
Oct
(125) |
Nov
(165) |
Dec
(65) |
| 2006 |
Jan
(90) |
Feb
(53) |
Mar
(121) |
Apr
(103) |
May
(113) |
Jun
(103) |
Jul
(104) |
Aug
(67) |
Sep
(78) |
Oct
(82) |
Nov
(78) |
Dec
(70) |
| 2007 |
Jan
(77) |
Feb
(76) |
Mar
(63) |
Apr
(30) |
May
(47) |
Jun
(41) |
Jul
(44) |
Aug
(44) |
Sep
(49) |
Oct
(33) |
Nov
(25) |
Dec
(21) |
| 2008 |
Jan
(45) |
Feb
(13) |
Mar
(15) |
Apr
(12) |
May
(9) |
Jun
(33) |
Jul
(30) |
Aug
(7) |
Sep
(20) |
Oct
(17) |
Nov
(20) |
Dec
(10) |
| 2009 |
Jan
(8) |
Feb
(5) |
Mar
(12) |
Apr
(17) |
May
(19) |
Jun
(97) |
Jul
(77) |
Aug
(33) |
Sep
(24) |
Oct
(41) |
Nov
(16) |
Dec
(32) |
| 2010 |
Jan
(24) |
Feb
(14) |
Mar
(50) |
Apr
(71) |
May
(70) |
Jun
(64) |
Jul
(45) |
Aug
(62) |
Sep
(32) |
Oct
(4) |
Nov
(12) |
Dec
(2) |
| 2011 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(3) |
May
(6) |
Jun
(1) |
Jul
(4) |
Aug
(3) |
Sep
(4) |
Oct
(6) |
Nov
(3) |
Dec
(3) |
| 2012 |
Jan
(4) |
Feb
(8) |
Mar
(6) |
Apr
(10) |
May
(2) |
Jun
(3) |
Jul
(11) |
Aug
(10) |
Sep
(4) |
Oct
|
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
(9) |
Apr
(1) |
May
(8) |
Jun
(2) |
Jul
(5) |
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(10) |
Dec
(8) |
| 2014 |
Jan
(3) |
Feb
(12) |
Mar
(9) |
Apr
(12) |
May
(2) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(2) |
| 2015 |
Jan
(1) |
Feb
(3) |
Mar
(4) |
Apr
(9) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(7) |
Oct
(9) |
Nov
(7) |
Dec
(9) |
| 2016 |
Jan
(7) |
Feb
(5) |
Mar
(5) |
Apr
(5) |
May
(8) |
Jun
(4) |
Jul
(5) |
Aug
(4) |
Sep
(6) |
Oct
(7) |
Nov
(2) |
Dec
(3) |
| 2017 |
Jan
(7) |
Feb
(8) |
Mar
(7) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(5) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(3) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
(5) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
| 2026 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jue...@we...> - 2004-04-28 08:00:08
|
Seems like you took your snapshot in the middle of my committing =
session... Please retry, everything should be consistent now.
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Matt Raible
Gesendet: Mi 28.04.2004 09:53
An: spr...@li...
Betreff: RE: [Springframework-developer] Wiring VelocityEngine with a =
DataSourceResourceLoader
Looks great Juergen, unfortunately the anonymous CVS gives me a build
error. Maybe the pserver is not synched up with ext?
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:24: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: package jdbc
[javac] import
org.springframework.jdbc.LobRetrievalFailureException;
[javac] ^
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:63: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: class
org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtra
ctor
[javac] throw new
LobRetrievalFailureException("Couldn't stream LOB
content", ex);
[javac] ^
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:76: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: class
org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtra
ctor
[javac] throw new LobRetrievalFailureException("No row
found in database");
[javac] ^
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:86: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: class
org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtra
ctor
[javac] throw new LobRetrievalFailureException("Multiple
rows found in database");
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -deprecation for details.
[javac] 4 errors
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...]
> On Behalf Of j=FCrgen h=F6ller [werk3AT]
> Sent: Wednesday, April 28, 2004 1:23 AM
> To: spr...@li...
> Subject: Re: [Springframework-developer] Wiring
> VelocityEngine with a DataSourceResourceLoader
>
>
> Matt,
>=20
> VelocityEngineFactoryBean's "resourceLoader" property is
> meant to take an implementation of Spring's
> org.springframework.core.io.ResourceLoader interface. When
> setting this, VelocityEngineFactoryBean will auto-configure
> the Velocity resource loader to load file-based templates via
> the Spring ResourceLoader. When running in an
> ApplicationContext, the context will set itself as the
> ResourceLoader, through the ResourceLoaderAware interface
> (implemented by VelocityEngineFactoryBean).
>=20
> What you need to do in your scenario is to set Velocity's
> "ds.resource.loader.instance" property accordingly.
> Unfortunately, VelocityEngineFactoryBean's
> "velocityProperties" property takes a java.util.Properties
> instance, just intended for String values. So I've just added
> a "velocityPropertiesMap" property that takes a
> java.util.Map, allowing for non-String values:
>=20
> <bean id=3D"velocityEngine"
> class=3D"org.springframework.ui.velocity.VelocityEngineFactoryBean"
> singleton=3D"true">
> <property name=3D"velocityProperties">
> <props>
> <prop key=3D"resource.loader">ds</prop>
> <prop
> key=3D"ds.resource.loader.resource.table">template</prop>
> <prop
> key=3D"ds.resource.loader.resource.keycolumn">name</prop>
> <prop
> key=3D"ds.resource.loader.resource.templatecolumn">content</prop>
> <prop
> =
key=3D"ds.resource.loader.resource.timestampcolumn">last_modified</prop>
> </props>
> </property>
> <property name=3D"velocityPropertiesMap">
> <map>
> <entry key=3D"ds.resource.loader.instance"><ref
> bean=3D"dataSource"/></prop>
> </map>
> </property>
> </bean>
>
> Of course, you can also define all your Velocity properties
> via "velocityPropertiesMap": You need to use the
> <map>/<entry> syntax for all properties then, though,
> wrapping all your String values with <value> tags.
>=20
> Juergen
>=20
>
> ________________________________
>
> Von: spr...@li... im
> Auftrag von Matt Raible
> Gesendet: Mi 28.04.2004 05:20
> An: spr...@li...
> Betreff: [Springframework-developer] Wiring VelocityEngine
> with a DataSourceResourceLoader
>
>
>
> I've been talking with some Velocity folks about modifying their
> DataSourceResourceLoader to allow setting the DataSource
> (currently it
> makes you specify a JNDI string in your properties). They have done
> this and provided a patch:
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=3D28611
>
> This is my idea of how it would be configured in Spring:
>
> <!-- Configure Velocity for sending e-mail -->
> <bean id=3D"velocityEngine"
> class=3D"org.springframework.ui.velocity.VelocityEngineFactoryBean"
> singleton=3D"true">
> <property name=3D"velocityProperties">
> <props>
> <prop key=3D"resource.loader">ds</prop>
> <prop
> key=3D"ds.resource.loader.resource.table">template</prop>
> <prop
> key=3D"ds.resource.loader.resource.keycolumn">name</prop>
> <prop
> key=3D"ds.resource.loader.resource.templatecolumn">content</prop>
> <prop
> =
key=3D"ds.resource.loader.resource.timestampcolumn">last_modified</prop>
> </props>
> </property>
> <property name=3D"resourceLoader"><ref
> local=3D"templateLoader"/></property>
> </bean>
>
> <bean id=3D"templateLoader" singleton=3D"true"
> =20
> class=3D"org.apache.velocity.runtime.resource.loader.DataSourceR
> esourceLoa
> der">
> <property name=3D"dataSource"><ref
> local=3D"dataSource"/></property> </bean>
>
> However, I get the following error:
>
> [junit] Caused by:
> org.springframework.beans.factory.BeanCreationException:
> Error creating
> bean with name 'velocityEngine' defined in class path resource
> [applicationContext.xml]: Error setting property values; nested
> exception is
> org.springframework.beans.PropertyAccessExceptionsException:
> PropertyAccessExceptionsException (1 errors); nested
> propertyAccessExceptions are:
> [org.springframework.beans.TypeMismatchException: Failed to convert
> property value of type
> [org.apache.velocity.runtime.resource.loader.DataSourceResourc
> eLoader]
> to required type [org.springframework.core.io.ResourceLoader] for
> property 'resourceLoader'; nested exception is
> java.lang.IllegalArgumentException: argument type mismatch]
>
> Is it possible to allow this, or some other way of initializing this
> ResourceLoader and putting it in the Engine? Here's the code you can
> use if you were programming this:
>
> DataSourceResourceLoader ds =3D new DataSourceResourceLoader();
> ds.setDataSource(DATASOURCE);
> Velocity.setProperty("ds.resource.loader.instance",ds);
> Velocity.init();
>
> Thanks,
>
> Matt
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market...
> Oracle 10g. Take an Oracle 10g class now, and we'll give you
> the exam FREE. =
http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market...
> Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id149&alloc_id=8166&op=CCk
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Matt R. <li...@ra...> - 2004-04-28 07:54:38
|
Looks great Juergen, unfortunately the anonymous CVS gives me a build
error. Maybe the pserver is not synched up with ext?
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:24: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: package jdbc
[javac] import
org.springframework.jdbc.LobRetrievalFailureException;
[javac] ^
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:63: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: class
org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtra
ctor
[javac] throw new
LobRetrievalFailureException("Couldn't stream LOB
content", ex);
[javac] ^
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:76: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: class
org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtra
ctor
[javac] throw new LobRetrievalFailureException("No row
found in database");
[javac] ^
[javac]
C:\Source\spring\src\org\springframework\jdbc\core\support\AbstractLobSt
reamingResultSet
Extractor.java:86: cannot resolve symbol
[javac] symbol : class LobRetrievalFailureException
[javac] location: class
org.springframework.jdbc.core.support.AbstractLobStreamingResultSetExtra
ctor
[javac] throw new LobRetrievalFailureException("Multiple
rows found in database");
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -deprecation for details.
[javac] 4 errors
> -----Original Message-----
> From: spr...@li...=20
> [mailto:spr...@li...]
> On Behalf Of j=FCrgen h=F6ller [werk3AT]
> Sent: Wednesday, April 28, 2004 1:23 AM
> To: spr...@li...
> Subject: Re: [Springframework-developer] Wiring=20
> VelocityEngine with a DataSourceResourceLoader
>=20
>=20
> Matt,
> =20
> VelocityEngineFactoryBean's "resourceLoader" property is=20
> meant to take an implementation of Spring's=20
> org.springframework.core.io.ResourceLoader interface. When=20
> setting this, VelocityEngineFactoryBean will auto-configure=20
> the Velocity resource loader to load file-based templates via=20
> the Spring ResourceLoader. When running in an=20
> ApplicationContext, the context will set itself as the=20
> ResourceLoader, through the ResourceLoaderAware interface=20
> (implemented by VelocityEngineFactoryBean).
> =20
> What you need to do in your scenario is to set Velocity's=20
> "ds.resource.loader.instance" property accordingly.=20
> Unfortunately, VelocityEngineFactoryBean's=20
> "velocityProperties" property takes a java.util.Properties=20
> instance, just intended for String values. So I've just added=20
> a "velocityPropertiesMap" property that takes a=20
> java.util.Map, allowing for non-String values:
> =20
> <bean id=3D"velocityEngine"=20
> class=3D"org.springframework.ui.velocity.VelocityEngineFactoryBean"=20
> singleton=3D"true">
> <property name=3D"velocityProperties">
> <props>
> <prop key=3D"resource.loader">ds</prop>
> <prop=20
> key=3D"ds.resource.loader.resource.table">template</prop>
> <prop=20
> key=3D"ds.resource.loader.resource.keycolumn">name</prop>
> <prop=20
> key=3D"ds.resource.loader.resource.templatecolumn">content</prop>
> <prop=20
> =
key=3D"ds.resource.loader.resource.timestampcolumn">last_modified</prop>
> </props>
> </property>
> <property name=3D"velocityPropertiesMap">
> <map>
> <entry key=3D"ds.resource.loader.instance"><ref=20
> bean=3D"dataSource"/></prop>
> </map>
> </property>
> </bean>
>=20
> Of course, you can also define all your Velocity properties=20
> via "velocityPropertiesMap": You need to use the=20
> <map>/<entry> syntax for all properties then, though,=20
> wrapping all your String values with <value> tags.
> =20
> Juergen
> =20
>=20
> ________________________________
>=20
> Von: spr...@li... im=20
> Auftrag von Matt Raible
> Gesendet: Mi 28.04.2004 05:20
> An: spr...@li...
> Betreff: [Springframework-developer] Wiring VelocityEngine=20
> with a DataSourceResourceLoader
>=20
>=20
>=20
> I've been talking with some Velocity folks about modifying their=20
> DataSourceResourceLoader to allow setting the DataSource=20
> (currently it=20
> makes you specify a JNDI string in your properties). They have done=20
> this and provided a patch:
>=20
> http://issues.apache.org/bugzilla/show_bug.cgi?id=3D28611
>=20
> This is my idea of how it would be configured in Spring:
>=20
> <!-- Configure Velocity for sending e-mail -->
> <bean id=3D"velocityEngine"=20
> class=3D"org.springframework.ui.velocity.VelocityEngineFactoryBean"=20
> singleton=3D"true">
> <property name=3D"velocityProperties">
> <props>
> <prop key=3D"resource.loader">ds</prop>
> <prop=20
> key=3D"ds.resource.loader.resource.table">template</prop>
> <prop=20
> key=3D"ds.resource.loader.resource.keycolumn">name</prop>
> <prop=20
> key=3D"ds.resource.loader.resource.templatecolumn">content</prop>
> <prop=20
> =
key=3D"ds.resource.loader.resource.timestampcolumn">last_modified</prop>
> </props>
> </property>
> <property name=3D"resourceLoader"><ref=20
> local=3D"templateLoader"/></property>
> </bean>
>=20
> <bean id=3D"templateLoader" singleton=3D"true"
> =20
> class=3D"org.apache.velocity.runtime.resource.loader.DataSourceR
> esourceLoa
> der">
> <property name=3D"dataSource"><ref=20
> local=3D"dataSource"/></property> </bean>
>=20
> However, I get the following error:
>=20
> [junit] Caused by:=20
> org.springframework.beans.factory.BeanCreationException:=20
> Error creating=20
> bean with name 'velocityEngine' defined in class path resource=20
> [applicationContext.xml]: Error setting property values; nested=20
> exception is=20
> org.springframework.beans.PropertyAccessExceptionsException:=20
> PropertyAccessExceptionsException (1 errors); nested=20
> propertyAccessExceptions are:=20
> [org.springframework.beans.TypeMismatchException: Failed to convert=20
> property value of type=20
> [org.apache.velocity.runtime.resource.loader.DataSourceResourc
> eLoader]=20
> to required type [org.springframework.core.io.ResourceLoader] for=20
> property 'resourceLoader'; nested exception is=20
> java.lang.IllegalArgumentException: argument type mismatch]
>=20
> Is it possible to allow this, or some other way of initializing this=20
> ResourceLoader and putting it in the Engine? Here's the code you can=20
> use if you were programming this:
>=20
> DataSourceResourceLoader ds =3D new DataSourceResourceLoader();
> ds.setDataSource(DATASOURCE);
> Velocity.setProperty("ds.resource.loader.instance",ds);
> Velocity.init();
>=20
> Thanks,
>=20
> Matt
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market...=20
> Oracle 10g. Take an Oracle 10g class now, and we'll give you=20
> the exam FREE. =
http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list=20
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market...=20
> Oracle 10g.=20
> Take an Oracle 10g class now, and we'll give you the exam FREE.=20
> http://ads.osdn.com/?ad_id149&alloc_id=8166&op=CCk
> _______________________________________________
> Springframework-developer mailing list=20
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
|
|
From: <jue...@we...> - 2004-04-28 07:40:22
|
I see. =20 I wonder whether it's worth adding a DelegatingRequestProcessor and a = DelegatingTilesRequestProcessor to our org.springframework.web.struts = package then: That approach is mainly useful when generating = struts-config via XDoclet, if I understand correctly. Of course, quite a = lot of people do use Struts with XDoclet. =20 What does everybody think? I've got those RequestProcessor subclasses = lying around already; the question is whether to include them in Spring = 1.0.2. Else, I'll add them to the sandbox for the time being. Votes, = please :-) =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Seth Ladd Gesendet: Mo 26.04.2004 23:54 An: spr...@li... Betreff: Re: [Springframework-developer] Re: struts integration - = alternate approach j=FCrgen h=F6ller [werk3AT] wrote: > Dan, >=20 > I've just done some prototypical tests. As far as I can tell, the only = benefit of the RequestProcessor approach is that you can write >=20 > <action path=3D"/test"/> > > rather than >=20 > <action path=3D"/test" = class=3D"org.springframework.web.struts.DelegatingActionProxy"/> >=20 > The disadvantage is that you need to have a special subclass of every = RequestProcessor that you might use: at least of the default = RequestProcessor and of TilesRequestProcessor. Some amount of code = duplication is inevitable there. And if you already have a custom = RequestProcessor, you need to subclass it on your own. >=20 > So all things considered, I still tend to recommend the = DelegatingActionProxy approach, which doesn't affect RequestProcessor = choice at all. Just saving the "class" attribute above does not seem to = be enough benefit to accept the RequestProcessor subclass hassle. Is = there anything I miss here? >=20 > Juergen >=20 > P.S.: > I'm forwarding this to developer list for further feedback. Juergen, For our integration here, we ended up subclassing RequestProcessor. The reason was because we're using xdoclet to build our struts-config.xml file. So IIRC we couldn't use DelegatingActionProxy (or the similar alternatives) because we needed Xdoclet to read into our action classes. Hope that helps, Seth ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=3D12297 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Tom T. <tom...@pr...> - 2004-04-28 07:39:02
|
Hello,
While upgrading to spring 1.0.1, I've noticed some minor annoyances that
may be easy to fix, possibly for 1.0.2:
1. HttpServletBean apparently does not support properties of type
Resource, because BeanWrapperImpl does not register a Resource property
editor by default. However, there's no possibility to register custom
editors with the BeanWrapper used by HttpServletBean. Maybe an
"initBeanWrapper" protected method could be added here, like initBinder
in BaseCommandController?
2. Unlike ResourceBundleMessageSource, ResourceBundleViewResolver only
has a basename property, no basenames property. As we keep controller
cfg, dao cfg and messages in separate resource files by functional
domain, it also makes sense to keep the view cfg in different files.
We're currently using an adapted ResourceBundleViewResolver, but maybe
this functionality could be added to spring, or maybe there's a good
reason to keep all view cfg in a single file?
3. In AbstractWizardFormController, it would be useful if processFinish
had an extra "int submissionPage" parameter (the currentPage value in
processFormSubmission could be passed to validatePagesAndFinish and on to
processFinish), though I have no suggestion how to add this in a
backward-compatible way...
It would be useful, because some of our legacy stored procedures perform
validation logic that we can't duplicate in java, i.e. the result of a
stored procedure could indicate a user-correctable error, which we would
like to display in the same way as a global validation error, e.g.:
protected ModelAndView processFinish( HttpServletRequest request,
HttpServletResponse response, Object command,
BindException errors, int page ) throws Exception {
// stored procedure is called in onSubmit,
// messageInfo is an output parameter
MessageInfo messageInfo = onSubmit( command );
if ( messageInfo.isError() ) {
errors.reject( "", messageInfo.getMessage() );
return showPage( request, errors, page );
}
if ( messageInfo.isWarning() ) {
return handleWarning( command, messageInfo );
}
return handleSuccess( command, messageInfo );
}
Note that getCurrentPage can't be called in processFinish, as we are
"after processFormSubmission".
Even if the page parameter can't be added to processFinish, it would
still be useful to add it to validatePagesAndFinish:
private ModelAndView validatePagesAndFinish(HttpServletRequest request,
HttpServletResponse response, Object command,
BindException errors, int currentPage) throws Exception {
// in case of binding errors -> show current page
if (errors.getErrorCount() - errors.getGlobalErrorCount() > 0) {
return showPage(request, errors, currentPage);
}
for (int page = 0; page < pages.length; page++) {
validatePage(command, errors, page);
// in case of field errors on a page -> show the page
if (errors.getErrorCount() - errors.getGlobalErrorCount() > 0) {
return showPage(request, errors, page);
}
}
// no field errors -> maybe global errors, or none at all
return processFinish(request, response, command, errors,
currentPage);
}
The first if was added to ensure the current page is shown again if there
were binding errors, such as typeMismatch. Otherwise, those errors will
always result in the first page being shown, instead of the submission
page where the error actually occured.
Also, shouldn't the "if (pages == null | pages.length == 0)" in setPages
use "||" instead of "|"?
Kind regards,
Tom.
|
|
From: <jue...@we...> - 2004-04-28 07:23:37
|
Matt,
=20
VelocityEngineFactoryBean's "resourceLoader" property is meant to take =
an implementation of Spring's org.springframework.core.io.ResourceLoader =
interface. When setting this, VelocityEngineFactoryBean will =
auto-configure the Velocity resource loader to load file-based templates =
via the Spring ResourceLoader. When running in an ApplicationContext, =
the context will set itself as the ResourceLoader, through the =
ResourceLoaderAware interface (implemented by =
VelocityEngineFactoryBean).
=20
What you need to do in your scenario is to set Velocity's =
"ds.resource.loader.instance" property accordingly. Unfortunately, =
VelocityEngineFactoryBean's "velocityProperties" property takes a =
java.util.Properties instance, just intended for String values. So I've =
just added a "velocityPropertiesMap" property that takes a =
java.util.Map, allowing for non-String values:
=20
<bean id=3D"velocityEngine"=20
class=3D"org.springframework.ui.velocity.VelocityEngineFactoryBean"=20
singleton=3D"true">
<property name=3D"velocityProperties">
<props>
<prop key=3D"resource.loader">ds</prop>
<prop=20
key=3D"ds.resource.loader.resource.table">template</prop>
<prop=20
key=3D"ds.resource.loader.resource.keycolumn">name</prop>
<prop=20
key=3D"ds.resource.loader.resource.templatecolumn">content</prop>
<prop=20
key=3D"ds.resource.loader.resource.timestampcolumn">last_modified</prop>
</props>
</property>
<property name=3D"velocityPropertiesMap">
<map>
<entry key=3D"ds.resource.loader.instance"><ref =
bean=3D"dataSource"/></prop>
</map>
</property>
</bean>
Of course, you can also define all your Velocity properties via =
"velocityPropertiesMap": You need to use the <map>/<entry> syntax for =
all properties then, though, wrapping all your String values with =
<value> tags.
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Matt Raible
Gesendet: Mi 28.04.2004 05:20
An: spr...@li...
Betreff: [Springframework-developer] Wiring VelocityEngine with a =
DataSourceResourceLoader
I've been talking with some Velocity folks about modifying their=20
DataSourceResourceLoader to allow setting the DataSource (currently it=20
makes you specify a JNDI string in your properties). They have done=20
this and provided a patch:
http://issues.apache.org/bugzilla/show_bug.cgi?id=3D28611
This is my idea of how it would be configured in Spring:
<!-- Configure Velocity for sending e-mail -->
<bean id=3D"velocityEngine"=20
class=3D"org.springframework.ui.velocity.VelocityEngineFactoryBean"=20
singleton=3D"true">
<property name=3D"velocityProperties">
<props>
<prop key=3D"resource.loader">ds</prop>
<prop=20
key=3D"ds.resource.loader.resource.table">template</prop>
<prop=20
key=3D"ds.resource.loader.resource.keycolumn">name</prop>
<prop=20
key=3D"ds.resource.loader.resource.templatecolumn">content</prop>
<prop=20
key=3D"ds.resource.loader.resource.timestampcolumn">last_modified</prop>
</props>
</property>
<property name=3D"resourceLoader"><ref=20
local=3D"templateLoader"/></property>
</bean>
<bean id=3D"templateLoader" singleton=3D"true"
=20
class=3D"org.apache.velocity.runtime.resource.loader.DataSourceResourceLo=
a
der">
<property name=3D"dataSource"><ref =
local=3D"dataSource"/></property>
</bean>
However, I get the following error:
[junit] Caused by:=20
org.springframework.beans.factory.BeanCreationException: Error creating=20
bean with name 'velocityEngine' defined in class path resource=20
[applicationContext.xml]: Error setting property values; nested=20
exception is=20
org.springframework.beans.PropertyAccessExceptionsException:=20
PropertyAccessExceptionsException (1 errors); nested=20
propertyAccessExceptions are:=20
[org.springframework.beans.TypeMismatchException: Failed to convert=20
property value of type=20
[org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader]=20
to required type [org.springframework.core.io.ResourceLoader] for=20
property 'resourceLoader'; nested exception is=20
java.lang.IllegalArgumentException: argument type mismatch]
Is it possible to allow this, or some other way of initializing this=20
ResourceLoader and putting it in the Engine? Here's the code you can=20
use if you were programming this:
DataSourceResourceLoader ds =3D new DataSourceResourceLoader();
ds.setDataSource(DATASOURCE);
Velocity.setProperty("ds.resource.loader.instance",ds);
Velocity.init();
Thanks,
Matt
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: <jue...@we...> - 2004-04-28 05:36:42
|
I assume you're running the Hibernate version: As of release 2.1.2, = Hibernate requires a JDBC 3.0 driver when running on J2SE 1.4, because = it auto-detects the capability for auto-generated keys - in the JDBC = interfaces, not in the driver implementation. So you need to use MySQL = Connector/J 3.x on J2SE 1.4, else you'll end up with an error that the = driver doesn't implement that particular method (like you did). On J2SE = 1.3, MySQL Connector/J 2.x is fine. =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Tom K Gesendet: Mi 28.04.2004 06:26 An: spr...@li... Betreff: [Springframework-developer] Petclinic Demo with mysql I'm "trying" to get the petclinic demo to work with mySQL. I can do = selects and updates but when I try to do an insert I get the error: =20 java.lang.AbstractMethodError: = com.mysql.jdbc.jdbc2.Connection.prepareStatement(Ljava/lang/String;I)Ljav= a/sql/PreparedStatement; =20 After hours of studying the documentation, I don't have a clue where my = problem is. =20 Any ideas what might be wrong? =20 TIA =20 Tom K. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 |
|
From: William G. T. Jr. <wg...@ru...> - 2004-04-28 04:30:04
|
Well, we are up to about 24 classes from org.springframework.web.servlet ported to org.springframework.web.portlet. DispatchPortlet is getting closer. One question is what to do about Action requests which are not expected to generate any View. Feels like I need another method on HandlerAdapter. // Render Requests ModelAndView handle(RenderRequest request, RenderResponse response); // Action Request void handle(ActionRequest request, ActionResponse response); maybe we'll be rendering views tomorrow... later. Bill William G. Thompson, Jr. wrote: > OK, I've almost got something we can play with... > > GenericPortlet -> PortletBean -> FrameworkPortlet -> DispatcherPortlet* > Plus various supporting objects which are mostly a mirror of > ...web.context and web.context.support. The Portlet API varies enough > to have to change most of these objects in subtle ways. Mostly it was a > cut&paste/replace Servlet with Portlet kind of a job. I had to deviate > from that approach when the Portlet API didn't have the same methods > available, getURI() for instance, or where the calling semantics are > different, like processAction/render vs doGet/doPost. > > * I'm just about to tackle DispatcherPortlet. It will differ from > DispatcherServlet in that it can have different HandlerAdaptors > configured per PortletMode (view, edit, help,...). Most likely > candidate for HandlerMappings keys are Request parameters and Session > attributes. > > The DispatcherPortlet also reflects the Portlet two step call with > abstract methods doRenderService() and doActionService() instead of just > doService(). Finally, the Porlet API assumes things like multipart > request and locale selection will be handled by the portal application > so multipartResolver and localeResolver are probably out. > > I am hoping to have something working in a few days. > > later. > Bill > > > > William G. Thompson, Jr. wrote: > >> We just upgraded our uPortal implementation to uP2.3 which supports >> the portlet api via pluto so we're ready to start experimenting with >> Spring support. I'd like to start a org.springframework.web.portlet >> package modeled after org.springframework.web.servlet. Has anyone >> started on this yet? >> >> Bill >> >> >> Rainer Schmitz wrote: >> >>> I followed the portlet thread a few days ago. I'm just starting to >>> learn about portlet development and as a Spring user I would like to >>> use a Portlet / Spring integration from the beginning. >>> >>> Are there any examples on how to compbine portlets and spring? What's >>> the state of the FrameworkPortlet development? >>> >>> Rainer >>> >>> >> > |
|
From: Tom K <tk...@co...> - 2004-04-28 04:26:23
|
I=92m =93trying=94 to get the petclinic demo to work with mySQL. I can = do selects and updates but when I try to do an insert I get the error: =20 java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Connection.prepareStatement(Ljava/lang/String;I)Lja va/sql/PreparedStatement; =20 After hours of studying the documentation, I don=92t have a clue where = my problem is. =20 Any ideas what might be wrong? =20 TIA =20 Tom K. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 =20 |
|
From: Matt R. <li...@ra...> - 2004-04-28 03:20:49
|
I've been talking with some Velocity folks about modifying their DataSourceResourceLoader to allow setting the DataSource (currently it makes you specify a JNDI string in your properties). They have done this and provided a patch: http://issues.apache.org/bugzilla/show_bug.cgi?id=28611 This is my idea of how it would be configured in Spring: <!-- Configure Velocity for sending e-mail --> <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean" singleton="true"> <property name="velocityProperties"> <props> <prop key="resource.loader">ds</prop> <prop key="ds.resource.loader.resource.table">template</prop> <prop key="ds.resource.loader.resource.keycolumn">name</prop> <prop key="ds.resource.loader.resource.templatecolumn">content</prop> <prop key="ds.resource.loader.resource.timestampcolumn">last_modified</prop> </props> </property> <property name="resourceLoader"><ref local="templateLoader"/></property> </bean> <bean id="templateLoader" singleton="true" class="org.apache.velocity.runtime.resource.loader.DataSourceResourceLoa der"> <property name="dataSource"><ref local="dataSource"/></property> </bean> However, I get the following error: [junit] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader] to required type [org.springframework.core.io.ResourceLoader] for property 'resourceLoader'; nested exception is java.lang.IllegalArgumentException: argument type mismatch] Is it possible to allow this, or some other way of initializing this ResourceLoader and putting it in the Engine? Here's the code you can use if you were programming this: DataSourceResourceLoader ds = new DataSourceResourceLoader(); ds.setDataSource(DATASOURCE); Velocity.setProperty("ds.resource.loader.instance",ds); Velocity.init(); Thanks, Matt |
|
From: Colin S. <col...@ex...> - 2004-04-28 03:03:44
|
btw Thomas, a few people have suggested a variation of your first choice below. However, while that covers having a key that's a bean reference, it doesn't cover the case where it's defined inline (as a value or other type)... tho...@tr... wrote: >I too think this would be valuable. > >I'd like to keep it simple. The following seems to me the most consistent with >the current syntax and with the Map interface itself: > ><map> > <entry keyref="myBean"> > <ref bean="myTarget"/> > </entry> ></map> > >or > ><map> > <entry> > <key> > <ref bean="myKeyBean"/> > </key> > <value> > <ref bean="myTargetBean"/> > </value> > </entry> ></map> > >This should also be valid, but I would not recommend using it: > ><map> > <entry> > <key> > <ref bean="myKeyBean"/> > </key> > <ref bean="myTargetBean"/> > </entry> ></map> > > >Thomas > > > >Quoting Colin Sampaleanu <col...@ex...>: > > > >>I agree it would be very good to have. I've been hit a few times by the >>lack. >> >>I am ok with your syntax, given that probably most of the uses will >>still be the simple case. An alternative would be to have another kind >>of entry allowed >> >><map> >> <complexentry> >> <key> >> <ref bean="myKey"/> >> </key> >> <value> >> <ref bean="myTarget"/> >> </value> >> </complexentry> >></map> >> >>'complexentry' is just a name I came up with now. I don't really like it >>or think it that suitable... >> >>Colin >> >> >>jürgen höller [werk3AT] wrote: >> >> >> >>>A colleague of mine just suggested that <entry> tags in XML bean definitions >>> >>> >>should also support non-String keys: After all, a java.util.Map can take any >>Object as key. >> >> >>>So instead of just the current: >>> >>><map> >>> <entry key="myKey"> >>> <ref bean="myTarget"/> >>> </entry> >>></map> >>> >>>We could also support something like the following: >>> >>><map> >>> <entry> >>> <key> >>> <ref bean="myKey"/> >>> </key> >>> <ref bean="myTarget"/> >>> </entry> >>></map> >>> >>>The problem is the syntax: It looks odd to have the <ref> Map value at the >>> >>> >>same level as the <key> subtag, with the latter having a nested <ref> >>again... >> >> >>>Any ideas? >>> >>>Juergen >>> >>> |
|
From: Les A. H. <le...@ha...> - 2004-04-27 23:23:21
|
I think the following two are the best candidates:
<map>
<entry>
<key bean=3D"myBean"/> <!-- or <key local=3D"myBean"/> -->
<value bean=3D"myTarget"/> <!-- or <value local=3D"myTarget"/> -->
</entry>
</map>
or (verbose version of above):
<map>
<entry>
<key><ref bean=3D"myBean"/></key>
<value><ref bean=3D"myTarget"/></value>
</entry>
</map>
I really like the first version, and I think it is the most readable. I don=
't
know if it would break backwards compatibility though. Whatever the decisio=
n I
think the most important factor (logically) is that the key and value elemen=
ts
remain xml peers to accurately reflect the Object structure.
So, the following (IMO) would not be a good candidate as it isn't readable a=
s
the first two and doesn't visually reflect the actual object structure of
Map.Entry :
<map>
<entry key=3D"myKey">
<ref bean=3D"myTarget"/>
</entry>
</map>
Les
Quoting tho...@tr...:
> I too think this would be valuable.
>
> I'd like to keep it simple. The following seems to me the most consistent
> with
> the current syntax and with the Map interface itself:
>
> <map>
> <entry keyref=3D"myBean">
> <ref bean=3D"myTarget"/>
> </entry>
> </map>
>
> or
>
> <map>
> <entry>
> <key>
> <ref bean=3D"myKeyBean"/>
> </key>
> <value>
> <ref bean=3D"myTargetBean"/>
> </value>
> </entry>
> </map>
>
> This should also be valid, but I would not recommend using it:
>
> <map>
> <entry>
> <key>
> <ref bean=3D"myKeyBean"/>
> </key>
> <ref bean=3D"myTargetBean"/>
> </entry>
> </map>
>
>
> Thomas
>
>
>
> Quoting Colin Sampaleanu <col...@ex...>:
>
> > I agree it would be very good to have. I've been hit a few times by the
> > lack.
> >
> > I am ok with your syntax, given that probably most of the uses will
> > still be the simple case. An alternative would be to have another kind
> > of entry allowed
> >
> > <map>
> > <complexentry>
> > <key>
> > <ref bean=3D"myKey"/>
> > </key>
> > <value>
> > <ref bean=3D"myTarget"/>
> > </value>
> > </complexentry>
> > </map>
> >
> > 'complexentry' is just a name I came up with now. I don't really like it
> > or think it that suitable...
> >
> > Colin
> >
> >
> > j=C3=BCrgen h=C3=B6ller [werk3AT] wrote:
> >
> > >A colleague of mine just suggested that <entry> tags in XML bean
> definitions
> > should also support non-String keys: After all, a java.util.Map can take
> any
> > Object as key.
> > >
> > >So instead of just the current:
> > >
> > ><map>
> > > <entry key=3D"myKey">
> > > <ref bean=3D"myTarget"/>
> > > </entry>
> > ></map>
> > >
> > >We could also support something like the following:
> > >
> > ><map>
> > > <entry>
> > > <key>
> > > <ref bean=3D"myKey"/>
> > > </key>
> > > <ref bean=3D"myTarget"/>
> > > </entry>
> > ></map>
> > >
> > >The problem is the syntax: It looks odd to have the <ref> Map value at =
the
> > same level as the <key> subtag, with the latter having a nested <ref>
> > again...
> > >
> > >Any ideas?
> > >
> > >Juergen
> > >
> > >
> > >DI J=C3=BCrgen H=C3=B6ller
> > >Senior System Architect
> > >______________________________________
> > >
> > >werk3ATS - division systementwicklung
> > >werk3AT informations- und mediensysteme
> > >
> > >europaplatz 4
> > >A - 4020 linz
> > >
> > >t. +43 (0) 732 71 65 29 502
> > >f. +43 (0) 732 71 65 29 3
> > >mailto:jue...@we...
> > >http://www.werk3at.com
> > >______________________________________
> > >werk3ATS - WIR ENTWICKELN ERFOLG
> > >
> > >
> > >-------------------------------------------------------
> > >This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> > >For a limited time only, get FREE Ground shipping on all orders of $35
> > >or more. Hurry up and shop folks, this offer expires April 30th!
> > >http://www.thinkgeek.com/freeshipping/?cpg=12297
> > >_______________________________________________
> > >Springframework-developer mailing list
> > >Spr...@li...
> > >https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > >
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> > For a limited time only, get FREE Ground shipping on all orders of $35
> > or more. Hurry up and shop folks, this offer expires April 30th!
> > http://www.thinkgeek.com/freeshipping/?cpg=12297
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> For a limited time only, get FREE Ground shipping on all orders of $35
> or more. Hurry up and shop folks, this offer expires April 30th!
> http://www.thinkgeek.com/freeshipping/?cpg=3D12297
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Dmitriy K. <dko...@ru...> - 2004-04-27 21:27:55
|
How about "mock" CVS tree and spring-mock.jar distribution? Regards, Dmitriy. Rod Johnson wrote: >Thanks for the cleaning up: they needed it. However, I feel uneasy about >these classes being included in spring.jar. I would like to see them in a >spring-test.jar. > >I don't particularly object to them going in the main /src tree, although >I'd really prefer a dedicated tree there as well. I'm sure that other stuff >will join them in such a new tree. > >Rgds, >Rod > >----- Original Message ----- >From: "Colin Sampaleanu" <col...@ex...> >To: <spr...@li...> >Cc: <spr...@li...> >Sent: Tuesday, April 27, 2004 9:30 PM >Subject: Re: [Springframework-developer] Re: [Springframework-user] Testing >Controllers and FormControllers > > >I'm ok with including these in Spring; if people feel they are too big, >they could be a spring-test add-on jar, that's not even included in the >main spring.jar which normally included all the optional stuff. That >makes some sense since this is for testing. > >jürgen höller [werk3AT] wrote: > > > >>Matt, everybody, >> >>Essentially, the Servlet API mocks in Spring's test directory are just >> >> >there because the MockObjects (http://www.mockobjects.com) Servlet API mocks >are so inconvenient to use. The current Spring-provided Servlet API mocks >are by no means in a polished state, though: They're just good enough for >being used within the framework test suite. They'd need some serious >refinement for making them public - after all, we have a reputation to lose >:-) > > >>So on that occasion, I've reworked those mocks today, making them >> >> >significantly more complete than before, and ready for getting included in >the Spring distribution. The question is: Where to include them? I'd like to >include them in the main Spring sources, in a org.springframework.web.mock >package: They would naturally be part of spring.jar and spring-web.jar then. >The test directory (where they currently reside) is no appropriate place, as >it is about testing the framework rather than providing infrastructure >classes. > > >>While it isn't in general appropriate to include mocks in the main Spring >> >> >codebase, I guess this is a different case: Those mocks are specifically >provided to ease testing of Spring web contexts (like >XmlWebApplicationContext or StaticWebApplicationContext that need a >ServletContext) and controllers (the Controller.handleRequest method needs >an HttpServletRequest and an HttpServletResponse). Including them in the >standard distribution would also indicate our strong focus on testability. > > >>The new MockServletContext implementation uses the >> >> >org.springframework.core.io.Resource API for resource loading, to allow for >ServletContext.getResourceAsStream from any resource base. So partly, the >mock implementations depend on low-level Spring API. We could of course keep >the mocks in a separate part of the Spring CVS, but it's just about a couple >of classes, thus hardly worth a separate source tree. > > >>IMO, the main concern regarding additions to the main Spring codebase is >> >> >whether those additions can potentially grow significantly: While Keith's >rules API in the sandbox has definite potential there (so had Ben Alex' >security framework that became the Acegi Security System), the recent Struts >support classes and those Servlet API mocks will at best see slight >refinements but certainly not exponential growth. So the former seems like a >candidate for a separate module to me, while the latter should fit into the >main Spring codebase. > > >>An important point to consider is that there are simply no mocks necessary >> >> >for testing most parts of a typical Spring app, respectively just interfaces >that can conveniently be mocked in a dynamic fashion with EasyMock. There >are just two exceptions, as far I see: Our SimpleNamingContext stuff eases >custom JNDI environments, and the newly refined set of Servlet API mocks >allows for convenient testing of Spring web MVC (and web contexts). > > >>Mocking an EJB container is next to impossible, so that's not worth further >> >> >consideration. JDBC can quite nicely be mocked with EasyMock; it's >preferable to use the JdbcOperations interface as far as possible, though. >Same for a Hibernate Session, with HibernateOperations being preferable. >It's more or less just the Servlet API that's really tedious to mock with >EasyMock, due to all those interdependent methods (e.g. URL paths, >parameters, attributes). > > >>What does everybody think? Does anyone mind including those polished >> >> >Servlet API mocks in the main Spring codebase, already for 1.0.2? Any >suggestions for alternatives? > > >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On Behalf Of >>Matt Raible >>Sent: Saturday, April 24, 2004 2:02 PM >>To: spr...@li... >>Subject: Re: [Springframework-user] Testing Controllers and >>FormControllers >> >> >>I use StrutsTestCase (http://strutstestcase.sf.net), which allows you >>to write very little code to test an Action. Here is a simple example >>of testing an "execute" method: >> >>package org.appfuse.webapp.action; >> >>import servletunit.struts.CactusStrutsTestCase; >>import org.appfuse.Constants; >> >>public class PersonActionTest extends CactusStrutsTestCase { >> >> public PersonActionTest(String name) { >> super(name); >> } >> >> public void testExecute() { >> // test execute method >> setRequestPathInfo("/editPerson"); >> addRequestParameter("id", "1"); >> actionPerform(); >> verifyNoActionErrors(); >> assertNotNull(getRequest().getAttribute(Constants.PERSON_KEY)); >> } >> >> public static void main(String[] args) { >> junit.textui.TestRunner.run(PersonActionTest.class); >> } >>} >> >>Since CactusStrutsTestCase extends from Cactus, I can also use Cactus's >>FormAuthentication support to mimic container-managed authentication. >> >>To test a "Save" is also pretty simple. >> >> public void testSave() throws Exception { >> setRequestPathInfo("/editPerson"); >> addRequestParameter("action", "Edit"); >> addRequestParameter("id", "1"); >> >> actionPerform(); >> >> assertTrue(getRequest().getAttribute(Constants.PERSON_KEY) != >>null); >> >> setRequestPathInfo("/savePerson"); >> addRequestParameter("action", "Save"); >> actionPerform(); >> verifyForward("edit"); >> verifyNoActionErrors(); >> } >> >>I think you have something similar to this with the Mock Object you're >>using in Spring. It just needs to be packaged up as a JAR. I'll be >>more than happy to write up some documentation on how to use it. >> >>Matt >> >> >>On Apr 24, 2004, at 4:27 AM, jürgen höller [werk3AT] wrote: >> >> >> >> >> >>>Matt, >>> >>>I just tried using MockHttpServletRequest and MockHttpServletResponse >>> >>> >>>from MockObjects with a Spring FormController. Unfortunately, those >> >> >>>MockObjects mocks are really not well-suited for testing here, as it's >>>so much hassle to setup any kind of HttpServletRequest method access. >>>What request/response mocks do you use for testing Struts Actions? >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag von >>>jürgen höller [werk3AT] >>>Gesendet: Sa 24.04.2004 10:57 >>>An: spr...@li... >>>Betreff: Re: [Springframework-user] Testing Controllers and >>>FormControllers >>> >>> >>> >>>I don't see much difference between testing Controllers and >>>FormControllers: Both share the same "ModelAndView >>>handleRequest(HttpServletRequest, HttpServletResponse)" method that >>>you need to invoke for testing. As of 1.0.1, you shouldn't need a >>>ServletContext mock anymore (except when actually accessing the >>>ServletContext), so all you need are HttpServletRequest and >>>HttpServletResponse mocks. The mocks provided by the MockObjects >>>project should be fine for this. >>> >>>Juergen >>> >>> >>>________________________________ >>> >>>Von: spr...@li... im Auftrag von >>>Matt Raible >>>Gesendet: Fr 23.04.2004 20:48 >>>An: spr...@li... >>>Betreff: [Springframework-user] Testing Controllers and FormControllers >>> >>> >>> >>>I've found it pretty simple to test Controllers, but FormControllers >>>are >>>a different story. From looking at the FormControllerTestSuite (URL >>>below), as well as many other Spring tests, it seems that a lot of >>>internal mocks are used to test this stuff. >>> >>>So my question is - what do you recommend for the average Spring MVC >>>person? What is the strategy we should be using to test our >>>controllers? Should we be using the Mocks that Spring provides? This >>>would certainly make things easier. If we're supposed to do that - is >>>it possible to get these mocks distributed in a JAR? >>> >>>Thanks, >>> >>>Matt >>> >>>http://monkeymachine.co.uk/spring/xref-test/org/springframework/web/ >>>serv >>>let/mvc/FormControllerTestSuite.html >>> >>> >>> >>> > > > >------------------------------------------------------- >This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >For a limited time only, get FREE Ground shipping on all orders of $35 >or more. Hurry up and shop folks, this offer expires April 30th! >http://www.thinkgeek.com/freeshipping/?cpg297 >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: Oracle 10g >Get certified on the hottest thing ever to hit the market... Oracle 10g. >Take an Oracle 10g class now, and we'll give you the exam FREE. >http://ads.osdn.com/?ad_id149&alloc_id?66&op=click >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Rod J. <rod...@in...> - 2004-04-27 21:13:33
|
Thanks for the cleaning up: they needed it. However, I feel uneasy about these classes being included in spring.jar. I would like to see them in a spring-test.jar. I don't particularly object to them going in the main /src tree, although I'd really prefer a dedicated tree there as well. I'm sure that other stu= ff will join them in such a new tree. Rgds, Rod ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <spr...@li...> Cc: <spr...@li...> Sent: Tuesday, April 27, 2004 9:30 PM Subject: Re: [Springframework-developer] Re: [Springframework-user] Testi= ng Controllers and FormControllers I'm ok with including these in Spring; if people feel they are too big, they could be a spring-test add-on jar, that's not even included in the main spring.jar which normally included all the optional stuff. That makes some sense since this is for testing. j=FCrgen h=F6ller [werk3AT] wrote: >Matt, everybody, > >Essentially, the Servlet API mocks in Spring's test directory are just there because the MockObjects (http://www.mockobjects.com) Servlet API mo= cks are so inconvenient to use. The current Spring-provided Servlet API mocks are by no means in a polished state, though: They're just good enough for being used within the framework test suite. They'd need some serious refinement for making them public - after all, we have a reputation to lo= se :-) > >So on that occasion, I've reworked those mocks today, making them significantly more complete than before, and ready for getting included i= n the Spring distribution. The question is: Where to include them? I'd like= to include them in the main Spring sources, in a org.springframework.web.moc= k package: They would naturally be part of spring.jar and spring-web.jar th= en. The test directory (where they currently reside) is no appropriate place,= as it is about testing the framework rather than providing infrastructure classes. > >While it isn't in general appropriate to include mocks in the main Sprin= g codebase, I guess this is a different case: Those mocks are specifically provided to ease testing of Spring web contexts (like XmlWebApplicationContext or StaticWebApplicationContext that need a ServletContext) and controllers (the Controller.handleRequest method need= s an HttpServletRequest and an HttpServletResponse). Including them in the standard distribution would also indicate our strong focus on testability. > >The new MockServletContext implementation uses the org.springframework.core.io.Resource API for resource loading, to allow f= or ServletContext.getResourceAsStream from any resource base. So partly, the mock implementations depend on low-level Spring API. We could of course k= eep the mocks in a separate part of the Spring CVS, but it's just about a cou= ple of classes, thus hardly worth a separate source tree. > >IMO, the main concern regarding additions to the main Spring codebase is whether those additions can potentially grow significantly: While Keith's rules API in the sandbox has definite potential there (so had Ben Alex' security framework that became the Acegi Security System), the recent Str= uts support classes and those Servlet API mocks will at best see slight refinements but certainly not exponential growth. So the former seems lik= e a candidate for a separate module to me, while the latter should fit into t= he main Spring codebase. > >An important point to consider is that there are simply no mocks necessa= ry for testing most parts of a typical Spring app, respectively just interfa= ces that can conveniently be mocked in a dynamic fashion with EasyMock. There are just two exceptions, as far I see: Our SimpleNamingContext stuff ease= s custom JNDI environments, and the newly refined set of Servlet API mocks allows for convenient testing of Spring web MVC (and web contexts). > >Mocking an EJB container is next to impossible, so that's not worth furt= her consideration. JDBC can quite nicely be mocked with EasyMock; it's preferable to use the JdbcOperations interface as far as possible, though. Same for a Hibernate Session, with HibernateOperations being preferable. It's more or less just the Servlet API that's really tedious to mock with EasyMock, due to all those interdependent methods (e.g. URL paths, parameters, attributes). > >What does everybody think? Does anyone mind including those polished Servlet API mocks in the main Spring codebase, already for 1.0.2? Any suggestions for alternatives? > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...]On Behalf Of >Matt Raible >Sent: Saturday, April 24, 2004 2:02 PM >To: spr...@li... >Subject: Re: [Springframework-user] Testing Controllers and >FormControllers > > >I use StrutsTestCase (http://strutstestcase.sf.net), which allows you >to write very little code to test an Action. Here is a simple example >of testing an "execute" method: > >package org.appfuse.webapp.action; > >import servletunit.struts.CactusStrutsTestCase; >import org.appfuse.Constants; > >public class PersonActionTest extends CactusStrutsTestCase { > > public PersonActionTest(String name) { > super(name); > } > > public void testExecute() { > // test execute method > setRequestPathInfo("/editPerson"); > addRequestParameter("id", "1"); > actionPerform(); > verifyNoActionErrors(); > assertNotNull(getRequest().getAttribute(Constants.PERSON_KEY)); > } > > public static void main(String[] args) { > junit.textui.TestRunner.run(PersonActionTest.class); > } >} > >Since CactusStrutsTestCase extends from Cactus, I can also use Cactus's >FormAuthentication support to mimic container-managed authentication. > >To test a "Save" is also pretty simple. > > public void testSave() throws Exception { > setRequestPathInfo("/editPerson"); > addRequestParameter("action", "Edit"); > addRequestParameter("id", "1"); > > actionPerform(); > > assertTrue(getRequest().getAttribute(Constants.PERSON_KEY) !=3D >null); > > setRequestPathInfo("/savePerson"); > addRequestParameter("action", "Save"); > actionPerform(); > verifyForward("edit"); > verifyNoActionErrors(); > } > >I think you have something similar to this with the Mock Object you're >using in Spring. It just needs to be packaged up as a JAR. I'll be >more than happy to write up some documentation on how to use it. > >Matt > > >On Apr 24, 2004, at 4:27 AM, j=FCrgen h=F6ller [werk3AT] wrote: > > > >>Matt, >> >>I just tried using MockHttpServletRequest and MockHttpServletResponse >>from MockObjects with a Spring FormController. Unfortunately, those >>MockObjects mocks are really not well-suited for testing here, as it's >>so much hassle to setup any kind of HttpServletRequest method access. >>What request/response mocks do you use for testing Struts Actions? >> >>Juergen >> >> >>________________________________ >> >>Von: spr...@li... im Auftrag von >>j=FCrgen h=F6ller [werk3AT] >>Gesendet: Sa 24.04.2004 10:57 >>An: spr...@li... >>Betreff: Re: [Springframework-user] Testing Controllers and >>FormControllers >> >> >> >>I don't see much difference between testing Controllers and >>FormControllers: Both share the same "ModelAndView >>handleRequest(HttpServletRequest, HttpServletResponse)" method that >>you need to invoke for testing. As of 1.0.1, you shouldn't need a >>ServletContext mock anymore (except when actually accessing the >>ServletContext), so all you need are HttpServletRequest and >>HttpServletResponse mocks. The mocks provided by the MockObjects >>project should be fine for this. >> >>Juergen >> >> >>________________________________ >> >>Von: spr...@li... im Auftrag von >>Matt Raible >>Gesendet: Fr 23.04.2004 20:48 >>An: spr...@li... >>Betreff: [Springframework-user] Testing Controllers and FormControllers >> >> >> >>I've found it pretty simple to test Controllers, but FormControllers >>are >>a different story. From looking at the FormControllerTestSuite (URL >>below), as well as many other Spring tests, it seems that a lot of >>internal mocks are used to test this stuff. >> >>So my question is - what do you recommend for the average Spring MVC >>person? What is the strategy we should be using to test our >>controllers? Should we be using the Mocks that Spring provides? This >>would certainly make things easier. If we're supposed to do that - is >>it possible to get these mocks distributed in a JAR? >> >>Thanks, >> >>Matt >> >>http://monkeymachine.co.uk/spring/xref-test/org/springframework/web/ >>serv >>let/mvc/FormControllerTestSuite.html >> >> ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Nadeem B. <na...@ea...> - 2004-04-27 20:45:33
|
I am really glad to see the popularity of spring rise.=20 On ?? 2004-04-27 at 15:45 -0400, tho...@tr... wrote: > Yes it is!! >=20 > Quoting "j=8F=AB=E4rgen h=8F=AB=D3ller [werk3AT]" <juergen.hoeller@werk3a= t.com>: >=20 > > ~10100 downloads in 4 weeks... Isn't that worth a news entry on > > springframework.org? :-) > > =20 > > Juergen > > =20 > >=20 > > ________________________________ > >=20 > > Von: spr...@li... im Auftrag v= on Rod > > Johnson > > Gesendet: Di 27.04.2004 12:55 > > An: spr...@li... > > Betreff: [Springframework-developer] Milestone > >=20 > >=20 > >=20 > > Spring 1.0 final just passed 10K downloads: 10,098 to be > > precise. In just under one calendar month! > >=20 > >=20 > > ------------------------------------------------------- > > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > > For a limited time only, get FREE Ground shipping on all orders of $35 > > or more. Hurry up and shop folks, this offer expires April 30th! > > http://www.thinkgeek.com/freeshipping/?cpg=3D12297 > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > > For a limited time only, get FREE Ground shipping on all orders of $35 > > or more. Hurry up and shop folks, this offer expires April 30th! > > http://www.thinkgeek.com/freeshipping/?cpg=12297 > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > >=20 >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=3D12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2004-04-27 20:30:25
|
I'm ok with including these in Spring; if people feel they are too big,=20 they could be a spring-test add-on jar, that's not even included in the=20 main spring.jar which normally included all the optional stuff. That=20 makes some sense since this is for testing. j=FCrgen h=F6ller [werk3AT] wrote: >Matt, everybody,=20 > >Essentially, the Servlet API mocks in Spring's test directory are just t= here because the MockObjects (http://www.mockobjects.com) Servlet API moc= ks are so inconvenient to use. The current Spring-provided Servlet API mo= cks are by no means in a polished state, though: They're just good enough= for being used within the framework test suite. They'd need some serious= refinement for making them public - after all, we have a reputation to l= ose :-) > >So on that occasion, I've reworked those mocks today, making them signif= icantly more complete than before, and ready for getting included in the = Spring distribution. The question is: Where to include them? I'd like to = include them in the main Spring sources, in a org.springframework.web.moc= k package: They would naturally be part of spring.jar and spring-web.jar = then. The test directory (where they currently reside) is no appropriate = place, as it is about testing the framework rather than providing infrast= ructure classes.=20 > >While it isn't in general appropriate to include mocks in the main Sprin= g codebase, I guess this is a different case: Those mocks are specificall= y provided to ease testing of Spring web contexts (like XmlWebApplication= Context or StaticWebApplicationContext that need a ServletContext) and co= ntrollers (the Controller.handleRequest method needs an HttpServletReques= t and an HttpServletResponse). Including them in the standard distributio= n would also indicate our strong focus on testability. > >The new MockServletContext implementation uses the org.springframework.c= ore.io.Resource API for resource loading, to allow for ServletContext.get= ResourceAsStream from any resource base. So partly, the mock implementati= ons depend on low-level Spring API. We could of course keep the mocks in = a separate part of the Spring CVS, but it's just about a couple of classe= s, thus hardly worth a separate source tree. > >IMO, the main concern regarding additions to the main Spring codebase is= whether those additions can potentially grow significantly: While Keith'= s rules API in the sandbox has definite potential there (so had Ben Alex'= security framework that became the Acegi Security System), the recent St= ruts support classes and those Servlet API mocks will at best see slight = refinements but certainly not exponential growth. So the former seems lik= e a candidate for a separate module to me, while the latter should fit in= to the main Spring codebase. > >An important point to consider is that there are simply no mocks necessa= ry for testing most parts of a typical Spring app, respectively just inte= rfaces that can conveniently be mocked in a dynamic fashion with EasyMock= . There are just two exceptions, as far I see: Our SimpleNamingContext st= uff eases custom JNDI environments, and the newly refined set of Servlet = API mocks allows for convenient testing of Spring web MVC (and web contex= ts). > >Mocking an EJB container is next to impossible, so that's not worth furt= her consideration. JDBC can quite nicely be mocked with EasyMock; it's pr= eferable to use the JdbcOperations interface as far as possible, though. = Same for a Hibernate Session, with HibernateOperations being preferable. = It's more or less just the Servlet API that's really tedious to mock with= EasyMock, due to all those interdependent methods (e.g. URL paths, param= eters, attributes). > >What does everybody think? Does anyone mind including those polished Ser= vlet API mocks in the main Spring codebase, already for 1.0.2? Any sugges= tions for alternatives? > >Juergen > > >-----Original Message-----=20 >From: spr...@li...=20 >[mailto:spr...@li...]On Behalf Of=20 >Matt Raible=20 >Sent: Saturday, April 24, 2004 2:02 PM=20 >To: spr...@li...=20 >Subject: Re: [Springframework-user] Testing Controllers and=20 >FormControllers=20 > > >I use StrutsTestCase (http://strutstestcase.sf.net), which allows you =20 >to write very little code to test an Action. Here is a simple example =20 >of testing an "execute" method:=20 > >package org.appfuse.webapp.action;=20 > >import servletunit.struts.CactusStrutsTestCase;=20 >import org.appfuse.Constants;=20 > >public class PersonActionTest extends CactusStrutsTestCase {=20 > =20 > public PersonActionTest(String name) {=20 > super(name);=20 > }=20 > > public void testExecute() {=20 > // test execute method=20 > setRequestPathInfo("/editPerson");=20 > addRequestParameter("id", "1");=20 > actionPerform();=20 > verifyNoActionErrors();=20 > assertNotNull(getRequest().getAttribute(Constants.PERSON_KEY));= =20 > }=20 > > public static void main(String[] args) {=20 > junit.textui.TestRunner.run(PersonActionTest.class);=20 > }=20 >}=20 > >Since CactusStrutsTestCase extends from Cactus, I can also use Cactus's = =20 >FormAuthentication support to mimic container-managed authentication.=20 > >To test a "Save" is also pretty simple.=20 > > public void testSave() throws Exception {=20 > setRequestPathInfo("/editPerson");=20 > addRequestParameter("action", "Edit");=20 > addRequestParameter("id", "1");=20 > > actionPerform();=20 > > assertTrue(getRequest().getAttribute(Constants.PERSON_KEY) !=3D= =20 >null);=20 > > setRequestPathInfo("/savePerson");=20 > addRequestParameter("action", "Save");=20 > actionPerform();=20 > verifyForward("edit");=20 > verifyNoActionErrors();=20 > }=20 > >I think you have something similar to this with the Mock Object you're =20 >using in Spring. It just needs to be packaged up as a JAR. I'll be =20 >more than happy to write up some documentation on how to use it.=20 > >Matt=20 > > >On Apr 24, 2004, at 4:27 AM, j=FCrgen h=F6ller [werk3AT] wrote:=20 > > =20 > >>Matt,=20 >> >>I just tried using MockHttpServletRequest and MockHttpServletResponse =20 >>from MockObjects with a Spring FormController. Unfortunately, those =20 >>MockObjects mocks are really not well-suited for testing here, as it's = =20 >>so much hassle to setup any kind of HttpServletRequest method access. =20 >>What request/response mocks do you use for testing Struts Actions?=20 >> >>Juergen=20 >> >> >>________________________________=20 >> >>Von: spr...@li... im Auftrag von =20 >>j=FCrgen h=F6ller [werk3AT]=20 >>Gesendet: Sa 24.04.2004 10:57=20 >>An: spr...@li...=20 >>Betreff: Re: [Springframework-user] Testing Controllers and =20 >>FormControllers=20 >> >> >> >>I don't see much difference between testing Controllers and =20 >>FormControllers: Both share the same "ModelAndView =20 >>handleRequest(HttpServletRequest, HttpServletResponse)" method that =20 >>you need to invoke for testing. As of 1.0.1, you shouldn't need a =20 >>ServletContext mock anymore (except when actually accessing the =20 >>ServletContext), so all you need are HttpServletRequest and =20 >>HttpServletResponse mocks. The mocks provided by the MockObjects =20 >>project should be fine for this.=20 >> >>Juergen=20 >> >> >>________________________________=20 >> >>Von: spr...@li... im Auftrag von =20 >>Matt Raible=20 >>Gesendet: Fr 23.04.2004 20:48=20 >>An: spr...@li...=20 >>Betreff: [Springframework-user] Testing Controllers and FormControllers= =20 >> >> >> >>I've found it pretty simple to test Controllers, but FormControllers =20 >>are=20 >>a different story. From looking at the FormControllerTestSuite (URL=20 >>below), as well as many other Spring tests, it seems that a lot of=20 >>internal mocks are used to test this stuff.=20 >> >>So my question is - what do you recommend for the average Spring MVC=20 >>person? What is the strategy we should be using to test our=20 >>controllers? Should we be using the Mocks that Spring provides? This=20 >>would certainly make things easier. If we're supposed to do that - is=20 >>it possible to get these mocks distributed in a JAR?=20 >> >>Thanks,=20 >> >>Matt=20 >> >>http://monkeymachine.co.uk/spring/xref-test/org/springframework/web/=20 >>serv=20 >>let/mvc/FormControllerTestSuite.html=20 >> =20 >> |
|
From: Rob M. <Rob...@pe...> - 2004-04-27 20:09:16
|
Hey, Matt, I ran into something similar -- perhaps it is the issue you are facing. If you are running in a container that doesn't follow the Servlet 2.4 initialization order you will not be able to use the ContextLoaderListener. Instead, you'll need to use the ContextLoaderServlet and ensure that it loads before the DispatcherServlet. When I came across this it was manifested by a failed dependency -- that is, the reference I expected to be available wasn't in the context so configuration failed. HTH, Rob Matt Raible wrote: > I figured out what the issue is - but don't know how to fix it. If I > put the validatorFactory into my "applicationContext.xml", then > everything works as expected. But if I put it into > "action-servlet.xml", then it doesn't work. It would be nice if it were > able to be in both places. If it can't be, it should probably be > documented and explained. > > Matt > |
|
From: Matt R. <li...@ra...> - 2004-04-27 19:55:39
|
+1 for including the polished Servlet API mocks in the main Spring
codebase. Here's an example of a UserFormControllerTest to test a
SimpleFormController using these mocks. They're not used much in this
example, but they sure make things a lot easier. The alternative is to
use Cactus to test these, but I've grown to loathe waiting for my
container to startup and run this stuff.
Matt
public class UserFormControllerTest extends TestCase {
private static Log log =3D
LogFactory.getLog(UserFormControllerTest.class);
private ApplicationContext ctx;
private UserFormController c;
public void setUp() throws Exception {
String[] paths =3D { "/applicationContext.xml",
"/action-servlet.xml" };
ctx =3D new ClassPathXmlApplicationContext(paths); =20
c =3D (UserFormController) ctx.getBean("userFormController");
}
=20
public void testDisplayEmptyForm() throws Exception {
MockHttpServletRequest request =3D
new MockHttpServletRequest(null, "GET", "/editUser.do");
HttpServletResponse response =3D new MockHttpServletResponse();
ModelAndView mv =3D c.handleRequest(request, response);
assertTrue("returned correct view name",
mv.getViewName().equals("userForm"));
}
public void testAddUser() throws Exception {
MockHttpServletRequest request =3D
new MockHttpServletRequest(null, "POST", "/editUser.do");
request.addParameter("firstName", "Matt");
request.addParameter("lastName", "Raible");
HttpServletResponse response =3D new MockHttpServletResponse();
ModelAndView mv =3D c.handleRequest(request, response);
Errors errors =3D
(Errors) mv.getModel().get(BindException.ERROR_KEY_PREFIX +
"user");
assertTrue("no errors returned in model", errors =3D=3D null);
assertNotNull(request.getSession().getAttribute("message"));
}
public void testSaveUserMissingLastName() throws Exception {
MockHttpServletRequest request =3D
new MockHttpServletRequest(null, "POST", "/editUser.do");
request.addParameter("firstName", "Julie");
HttpServletResponse response =3D new MockHttpServletResponse();
ModelAndView mv =3D c.handleRequest(request, response);
Errors errors =3D
(Errors) mv.getModel().get(BindException.ERROR_KEY_PREFIX +
"user");
assertTrue("errors returned in model", errors !=3D null);
assertNull(request.getSession().getAttribute("message"));
} =20
}
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...]
> On Behalf Of j=FCrgen h=F6ller [werk3AT]
> Sent: Tuesday, April 27, 2004 11:58 AM
> To: spr...@li...
> Cc: spr...@li...
> Subject: [Springframework-developer] Re:=20
> [Springframework-user] Testing Controllers and FormControllers
>=20
>=20
> Matt, everybody,
>=20
> Essentially, the Servlet API mocks in Spring's test directory
> are just there because the MockObjects=20
> (http://www.mockobjects.com) Servlet API mocks are so=20
> inconvenient to use. The current Spring-provided Servlet API=20
> mocks are by no means in a polished state, though: They're=20
> just good enough for being used within the framework test=20
> suite. They'd need some serious refinement for making them=20
> public - after all, we have a reputation to lose :-)
>=20
> So on that occasion, I've reworked those mocks today, making
> them significantly more complete than before, and ready for=20
> getting included in the Spring distribution. The question is:=20
> Where to include them? I'd like to include them in the main=20
> Spring sources, in a org.springframework.web.mock package:=20
> They would naturally be part of spring.jar and spring-web.jar=20
> then. The test directory (where they currently reside) is no=20
> appropriate place, as it is about testing the framework=20
> rather than providing infrastructure classes.=20
>=20
> While it isn't in general appropriate to include mocks in the
> main Spring codebase, I guess this is a different case: Those=20
> mocks are specifically provided to ease testing of Spring web=20
> contexts (like XmlWebApplicationContext or=20
> StaticWebApplicationContext that need a ServletContext) and=20
> controllers (the Controller.handleRequest method needs an=20
> HttpServletRequest and an HttpServletResponse). Including=20
> them in the standard distribution would also indicate our=20
> strong focus on testability.
>=20
> The new MockServletContext implementation uses the
> org.springframework.core.io.Resource API for resource=20
> loading, to allow for ServletContext.getResourceAsStream from=20
> any resource base. So partly, the mock implementations depend=20
> on low-level Spring API. We could of course keep the mocks in=20
> a separate part of the Spring CVS, but it's just about a=20
> couple of classes, thus hardly worth a separate source tree.
>=20
> IMO, the main concern regarding additions to the main Spring
> codebase is whether those additions can potentially grow=20
> significantly: While Keith's rules API in the sandbox has=20
> definite potential there (so had Ben Alex' security framework=20
> that became the Acegi Security System), the recent Struts=20
> support classes and those Servlet API mocks will at best see=20
> slight refinements but certainly not exponential growth. So=20
> the former seems like a candidate for a separate module to=20
> me, while the latter should fit into the main Spring codebase.
>=20
> An important point to consider is that there are simply no
> mocks necessary for testing most parts of a typical Spring=20
> app, respectively just interfaces that can conveniently be=20
> mocked in a dynamic fashion with EasyMock. There are just two=20
> exceptions, as far I see: Our SimpleNamingContext stuff eases=20
> custom JNDI environments, and the newly refined set of=20
> Servlet API mocks allows for convenient testing of Spring web=20
> MVC (and web contexts).
>=20
> Mocking an EJB container is next to impossible, so that's not
> worth further consideration. JDBC can quite nicely be mocked=20
> with EasyMock; it's preferable to use the JdbcOperations=20
> interface as far as possible, though. Same for a Hibernate=20
> Session, with HibernateOperations being preferable. It's more=20
> or less just the Servlet API that's really tedious to mock=20
> with EasyMock, due to all those interdependent methods (e.g.=20
> URL paths, parameters, attributes).
>=20
> What does everybody think? Does anyone mind including those
> polished Servlet API mocks in the main Spring codebase,=20
> already for 1.0.2? Any suggestions for alternatives?
>=20
> Juergen
>=20
>=20
> -----Original Message-----
> From: spr...@li...=20
> [mailto:spr...@li...]On Behalf Of=20
> Matt Raible=20
> Sent: Saturday, April 24, 2004 2:02 PM=20
> To: spr...@li...=20
> Subject: Re: [Springframework-user] Testing Controllers and=20
> FormControllers=20
>=20
>=20
> I use StrutsTestCase (http://strutstestcase.sf.net), which
> allows you =20
> to write very little code to test an Action. Here is a=20
> simple example =20
> of testing an "execute" method:=20
>=20
> package org.appfuse.webapp.action;
>=20
> import servletunit.struts.CactusStrutsTestCase;
> import org.appfuse.Constants;=20
>=20
> public class PersonActionTest extends CactusStrutsTestCase {
> =20
> public PersonActionTest(String name) {=20
> super(name);=20
> }
>=20
> public void testExecute() {=20
> // test execute method=20
> setRequestPathInfo("/editPerson");=20
> addRequestParameter("id", "1");=20
> actionPerform();=20
> verifyNoActionErrors();
> =20
> assertNotNull(getRequest().getAttribute(Constants.PERSON_KEY));=20
> }
>=20
> public static void main(String[] args) {=20
> junit.textui.TestRunner.run(PersonActionTest.class);=20
> }
> }=20
>=20
> Since CactusStrutsTestCase extends from Cactus, I can also
> use Cactus's =20
> FormAuthentication support to mimic container-managed authentication.=20
>=20
> To test a "Save" is also pretty simple.
>=20
> public void testSave() throws Exception {=20
> setRequestPathInfo("/editPerson");=20
> addRequestParameter("action", "Edit");=20
> addRequestParameter("id", "1");
>=20
> actionPerform();
>=20
> =20
> assertTrue(getRequest().getAttribute(Constants.PERSON_KEY) !=3D
> null);=20
>=20
> setRequestPathInfo("/savePerson");=20
> addRequestParameter("action", "Save");=20
> actionPerform();=20
> verifyForward("edit");=20
> verifyNoActionErrors();=20
> }
>=20
> I think you have something similar to this with the Mock
> Object you're =20
> using in Spring. It just needs to be packaged up as a JAR. I'll be =20
> more than happy to write up some documentation on how to use it.=20
>=20
> Matt
>=20
>=20
> On Apr 24, 2004, at 4:27 AM, j=FCrgen h=F6ller [werk3AT] wrote:
>=20
> > Matt,
> >=20
> > I just tried using MockHttpServletRequest and
> MockHttpServletResponse
> > from MockObjects with a Spring FormController.
> Unfortunately, those
> > MockObjects mocks are really not well-suited for testing
> here, as it's
> > so much hassle to setup any kind of HttpServletRequest
> method access.
> > What request/response mocks do you use for testing Struts Actions?
> >=20
> > Juergen
> >=20
> >=20
> > ________________________________
> >=20
> > Von: spr...@li... im Auftrag von
> > j=FCrgen h=F6ller [werk3AT]
> > Gesendet: Sa 24.04.2004 10:57
> > An: spr...@li...=20
> > Betreff: Re: [Springframework-user] Testing Controllers and =20
> > FormControllers=20
> >=20
> >=20
> >=20
> > I don't see much difference between testing Controllers and
> > FormControllers: Both share the same "ModelAndView
> > handleRequest(HttpServletRequest, HttpServletResponse)"=20
> method that
> > you need to invoke for testing. As of 1.0.1, you shouldn't need a
> > ServletContext mock anymore (except when actually accessing the =20
> > ServletContext), so all you need are HttpServletRequest and =20
> > HttpServletResponse mocks. The mocks provided by the MockObjects =20
> > project should be fine for this.=20
> >=20
> > Juergen
> >=20
> >=20
> > ________________________________
> >=20
> > Von: spr...@li... im Auftrag von
> > Matt Raible
> > Gesendet: Fr 23.04.2004 20:48
> > An: spr...@li...=20
> > Betreff: [Springframework-user] Testing Controllers and=20
> FormControllers
> >=20
> >=20
> >=20
> > I've found it pretty simple to test Controllers, but FormControllers
> > are a different story. From looking at the
> FormControllerTestSuite (URL
> > below), as well as many other Spring tests, it seems that a lot of
> > internal mocks are used to test this stuff.=20
> >=20
> > So my question is - what do you recommend for the average Spring MVC
> > person? What is the strategy we should be using to test our=20
> > controllers? Should we be using the Mocks that Spring
> provides? This
> > would certainly make things easier. If we're supposed to
> do that - is
> > it possible to get these mocks distributed in a JAR?
> >=20
> > Thanks,
> >=20
> > Matt
> >=20
> > http://monkeymachine.co.uk/spring/xref-test/org/springframework/web/
> > serv
> > let/mvc/FormControllerTestSuite.html=20
> >=20
> >=20
> >=20
> >=20
> > -------------------------------------------------------
> > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> > For a limited time only, get FREE Ground shipping on all=20
> orders of $35
> > or more. Hurry up and shop folks, this offer expires April 30th!
> > http://www.thinkgeek.com/freeshipping/?cpg=3D12297=20
> > _______________________________________________=20
> > Springframework-user mailing list=20
> > Spr...@li...=20
> > https://lists.sourceforge.net/lists/listinfo/springframework-user=20
> >=20
> >=20
> >=20
> >=20
> > -------------------------------------------------------
> > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> > For a limited time only, get FREE Ground shipping on all=20
> orders of $35
> > or more. Hurry up and shop folks, this offer expires April 30th!
> > http://www.thinkgeek.com/freeshipping/?cpg=12297=20
> > _______________________________________________=20
> > Springframework-user mailing list=20
> > Spr...@li...=20
> > https://lists.sourceforge.net/lists/listinfo/springframework-user=20
> >=20
> >=20
> >=20
> >=20
> > -------------------------------------------------------
> > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
> > For a limited time only, get FREE Ground shipping on all=20
> orders of $35
> > or more. Hurry up and shop folks, this offer expires April 30th!
> > http://www.thinkgeek.com/freeshipping/?cpg=12297=20
> > _______________________________________________=20
> > Springframework-user mailing list=20
> > Spr...@li...=20
> > https://lists.sourceforge.net/lists/listinfo/springframework-user=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek=20
> For a limited time only, get FREE Ground shipping on all=20
> orders of $35=20
> or more. Hurry up and shop folks, this offer expires April 30th!=20
> http://www.thinkgeek.com/freeshipping/?cpg=12297=20
> _______________________________________________=20
> Springframework-user mailing list=20
> Spr...@li...=20
> https://lists.sourceforge.net/lists/listinfo/springframework-user=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek=20
> For a limited time only, get FREE Ground shipping on all orders of $35
> or more. Hurry up and shop folks, this offer expires April 30th!=20
> http://www.thinkgeek.com/freeshipping/?cpg=12297
> _______________________________________________
> Springframework-developer mailing list=20
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
|
|
From: Les A. H. <le...@ha...> - 2004-04-27 19:46:49
|
Hiya folks, I found the PropertyValue class and the PropertyValues interfaces to be quite useful and wanted to use them internally. I needed to subclass the PropertyValue class to provide some custom functionality. These custom subclasses need to be passed over the wire to client applets outside the server vm. Well, I just found out that isn't possible with the way PropertyValue is coded. The PropertyValue class does not implement Serializable and doesn't have a default, no-arg constructor. After some digging around, I found that if the parent class does not implement Serializable, it has to have at least a default, no-arg constructor if any children classes want to be Serializable. The PropertyValue class does not have either. Would there be any harm in making that class JavaBeans compatible and implement Serializable? For now, we're creating duplicate copies of both PropertyValue and PropertyValues in our package structure to get around this problem. I know those classes are primarily meant to be SPI classes, but I didn't think the addition of those things would hurt anyone (and would be nice to boot ;) ) Your thoughts? Thanks again, Les P.S. My requirement is that I have to save generic PropertyValues in the database using Hibernate. A default no-arg constructor and mutator methods for property name and value would make Hibernate happy. |
|
From: <tho...@tr...> - 2004-04-27 19:45:44
|
Yes it is!! Quoting "jürgen höller [werk3AT]" <jue...@we...>: > ~10100 downloads in 4 weeks... Isn't that worth a news entry on > springframework.org? :-) > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag von Rod > Johnson > Gesendet: Di 27.04.2004 12:55 > An: spr...@li... > Betreff: [Springframework-developer] Milestone > > > > Spring 1.0 final just passed 10K downloads: 10,098 to be > precise. In just under one calendar month! > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Matt R. <ma...@ra...> - 2004-04-27 19:45:20
|
I figured out what the issue is - but don't know how to fix it. If I
put the validatorFactory into my "applicationContext.xml", then
everything works as expected. But if I put it into
"action-servlet.xml", then it doesn't work. It would be nice if it were
able to be in both places. If it can't be, it should probably be
documented and explained.
Matt
> -----Original Message-----
> From: Keith Donald [mailto:kd...@cs...]=20
> Sent: Tuesday, April 27, 2004 12:27 PM
> To: 'Matt Raible'
> Subject: FW: [Springframework-developer] [Commons Validator]=20
> Error on Startup
>=20
>=20
> Hey Matt,
>=20
> I fixed the .tld problem.
>=20
> The other one is interesting. I need to verify
> beanOfTypeIncludingAncestors() is working properly - it=20
> should catch any beans that implement=20
> ValidatorFactory.class...but apparently it's not. Your=20
> config looks right to me.
>=20
> I will try to reproduce it as soon as all possible (I'm=20
> really busy today-tommorow though:(). If you need it now,=20
> try changing "ValidatorFactory.class" below in the=20
> getValidatorResources() method to=20
> "DefaultValidatorFactory.class" and see if that clears it up.=20
> Hell, I can do that temporarily for you if you like. =20
> That'll at least give me a good idea if=20
> beanOfTypeIncludingAncestors is working properly.
>=20
> Thanks,
> Keith
> =20
> Keith Donald
> Software Architect
> kd...@cs...
> 321-676-2923 x403
> =20
> =20
>=20
>=20
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...]
> On Behalf Of Matt Raible
> Sent: Tuesday, April 27, 2004 12:23 PM
> To: spr...@li...
> Subject: RE: [Springframework-developer] [Commons Validator]=20
> Error on Startup
>=20
>=20
> Doh - spoke to soon. It seems like the following is failing in the
> JavaScriptValidatorTag:
>=20
> private ValidatorResources getValidatorResources() {
> ListableBeanFactory lbf =3D WebApplicationContextUtils
> =20
> .getRequiredWebApplicationContext(pageContext.getServletContext());
> ValidatorFactory factory =3D (ValidatorFactory)=20
> BeanFactoryUtils
> .beanOfTypeIncludingAncestors(lbf,
> ValidatorFactory.class, true, true);
> return factory.getValidatorResources();
> }
>=20
> I'm getting the following error now:
>=20
> org.springframework.beans.factory.NoSuchBeanDefinitionExceptio
> n: No unique bean of type=20
> [org.springframework.validation.commons.ValidatorFactory] is
> defined: Expected single bean but found 0
> =09
> org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeI
> ncludingAn
> cestors(BeanFactoryUtils.java:147)
> =09
> org.springframework.validation.commons.taglib.JavascriptValida
> torTag.get
> ValidatorResources(JavascriptValidatorTag.java:773)
> =09
> org.springframework.validation.commons.taglib.JavascriptValida
> torTag.doS
> tartTag(JavascriptValidatorTag.java:346)
> =09
> org.apache.jsp.scripts.validator_jsp._jspx_meth_html_javascrip
> t_0(valida
> tor_jsp.java:78)
> =09
> org.apache.jsp.scripts.validator_jsp._jspService(validator_jsp
> .java:55)
> =09
>=20
> Maybe my validatorFactory syntax is wrong?
>=20
> <bean id=3D"validatorFactory"=20
> class=3D"org.springframework.validation.commons.DefaultValidator
> Factory"=20
> init-method=3D"init">
> <property name=3D"resources">
> <list>
> =09
> <value>WEB-INF/validator-rules.xml</value>
> <value>WEB-INF/validation.xml</value>
> </list>
> </property>
> </bean>
>=20
> BTW, I also had to change "spring-commons-validator.tld" to=20
> *not* require
> formName:
>=20
> <attribute>
> <name>formName</name>
> <required>false</required>
> <rtexprvalue>true</rtexprvalue>
> </attribute>
>=20
> This is how Struts does it and its necessary to make a=20
> standalone JavaScript/JSP work.
>=20
> Thanks,
>=20
> Matt
>=20
> > -----Original Message-----
> > From: Matt Raible [mailto:li...@ra...]
> > Sent: Tuesday, April 27, 2004 9:26 AM
> > To: 'spr...@li...'
> > Subject: RE: [Springframework-developer] [Commons Validator]
> > Error on Startup
> >=20
> >=20
> > Thanks Keith - problem fixed!
> >=20
> > Matt
> >=20
> > > -----Original Message-----
> > > From: spr...@li...
> > > [mailto:spr...@li...]
> > > On Behalf Of Keith Donald
> > > Sent: Tuesday, April 27, 2004 8:30 AM
> > > To: spr...@li...
> > > Subject: RE: [Springframework-developer] [Commons=20
> Validator] Error=20
> > > on Startup
> > >=20
> > >=20
> > > ValidatorFactory is now a interface -=20
> DefaultValidatorFactory is the
> > > implementation. Daniel made it an interface to be a bit more=20
> > > flexible for those who had custom validation-xml loading=20
> > > requirements.
> > >=20
> > > Keith
> > >=20
> > > -----Original Message-----
> > > From: spr...@li...
> > > [mailto:spr...@li...]
> > > On Behalf Of Matt Raible
> > > Sent: Tuesday, April 27, 2004 2:51 AM
> > > To: spr...@li...
> > > Subject: [Springframework-developer] [Commons Validator] Error on
> > > Startup
> > >=20
> > >=20
> > > I grabbed a fresh checkout from CVS tonight, expecting that the
> > > commons validator stuff still worked. Unfortunately,=20
> (from what I=20
> > > can tell) it does not. Here's the error I get on startup:
> > >=20
> > > ERROR - FrameworkServlet.initServletBean(207) | Context
> > > initialization failed=20
> > > org.springframework.beans.factory.BeanDefinitionStoreException
> > > : Error registering bean with name 'va lidatorFactory'
> > > defined in resource [/WEB-INF/action-servlet.xml] of
> > > ServletContext: Validation of b
> > > ean definition with name failed; nested exception is=20
> > > org.springframework.beans.factory.support.BeanD
> > > efinitionValidationException: No public constructor in class=20
> > > [interface org.springframework.validati=20
> > > on.commons.ValidatorFactory]=20
> > > org.springframework.beans.factory.support.BeanDefinitionValida
> > > tionExcept
> > > ion: No public constructor i
> > > n class [interface=20
> > > org.springframework.validation.commons.ValidatorFactory]
> > > at=20
> > > org.springframework.beans.factory.support.RootBeanDefinition.v
> > > alidate(Ro
> > > otBeanDefinition.
> > > java:334)
> > > at=20
> > > org.springframework.beans.factory.support.DefaultListableBeanF
> > > actory.reg
> > > isterBeanDefiniti
> > > on(DefaultListableBeanFactory.java:194)
> > > at=20
> > > org.springframework.beans.factory.xml.DefaultXmlBeanDefinition
> > > Parser.loa
> > > dBeanDefinition(D
> > > efaultXmlBeanDefinitionParser.java:214)
> > > at=20
> > > org.springframework.beans.factory.xml.DefaultXmlBeanDefinition
> > > Parser.reg
> > > isterBeanDefiniti
> > > ons(DefaultXmlBeanDefinitionParser.java:152)
> > > at=20
> > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.
> > > registerBe
> > > anDefinitions(Xml
> > > BeanDefinitionReader.java:161)
> > > at=20
> > > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.
> > > loadBeanDe
> > > finitions(XmlBean
> > > DefinitionReader.java:127)
> > >=20
> > > ----------------------------------------
> > >=20
> > > Here's my config:
> > >=20
> > > <bean id=3D"validatorFactory"
> > > class=3D"org.springframework.validation.commons.ValidatorFactory"
> > > init-method=3D"init">
> > > <property name=3D"resources">
> > > <list>
> > > =09
> > > <value>WEB-INF/validator-rules.xml</value>
> > > <value>WEB-INF/validation.xml</value>
> > > </list>
> > > </property>
> > > </bean>
> > >=20
> > > <bean id=3D"beanValidator"
> > > class=3D"org.springframework.validation.commons.BeanValidator">
> > > <property name=3D"validatorFactory"><ref
> > > local=3D"validatorFactory"/></property>
> > > </bean>
> > >=20
> > > Any ideas?
> > >=20
> > > Thanks,
> > >=20
> > > Matt
> > >=20
> > >=20
> > >=20
> > >=20
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: The Robotic Monkeys at=20
> ThinkGeek
> > > For a limited time only, get FREE Ground shipping on all=20
> orders of=20
> > > $35 or more. Hurry up and shop folks, this offer expires=20
> April 30th!
> > > http://www.thinkgeek.com/freeshipping/?cpg=3D> 12297
> > >=20
> > > _______________________________________________
> > >=20
> > > Springframework-developer mailing list
> > > Spr...@li...
> > >=20
> > https://lists.sourceforge.net/lists/listinfo/s>
> pringframework-developer
> > >=20
> > >=20
> > >=20
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: The Robotic Monkeys at=20
> ThinkGeek
> > > For a limited time only, get FREE Ground shipping on all=20
> orders of=20
> > > $35 or more. Hurry up and shop folks, this offer expires=20
> April 30th!
> > > http://www.thinkgeek.com/freeshipping/?cpg=12297
> > >=20
> > > _______________________________________________
> > > Springframework-developer mailing list
> > > Spr...@li...
> > >=20
> > https://lists.sourceforge.net/lists/listinfo/s>
> pringframework-developer
> > >=20
> >=20
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: The Robotic Monkeys at=20
> ThinkGeek For a limited time only, get FREE Ground shipping=20
> on all orders of $35 or more. Hurry up and shop folks, this=20
> offer expires April 30th!=20
> http://www.thinkgeek.com/freeshipping/?cpg=12297
>=20
> _______________________________________________
> Springframework-developer mailing list=20
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
|
|
From: <jue...@we...> - 2004-04-27 18:17:43
|
~10100 downloads in 4 weeks... Isn't that worth a news entry on = springframework.org? :-) =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von Rod Johnson Gesendet: Di 27.04.2004 12:55 An: spr...@li... Betreff: [Springframework-developer] Milestone Spring 1.0 final just passed 10K downloads: 10,098 to be precise. In just under one calendar month! ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=3D12297 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <jue...@we...> - 2004-04-27 17:58:44
|
Matt, everybody,=20 Essentially, the Servlet API mocks in Spring's test directory are just = there because the MockObjects (http://www.mockobjects.com) Servlet API = mocks are so inconvenient to use. The current Spring-provided Servlet = API mocks are by no means in a polished state, though: They're just good = enough for being used within the framework test suite. They'd need some = serious refinement for making them public - after all, we have a = reputation to lose :-) So on that occasion, I've reworked those mocks today, making them = significantly more complete than before, and ready for getting included = in the Spring distribution. The question is: Where to include them? I'd = like to include them in the main Spring sources, in a = org.springframework.web.mock package: They would naturally be part of = spring.jar and spring-web.jar then. The test directory (where they = currently reside) is no appropriate place, as it is about testing the = framework rather than providing infrastructure classes.=20 While it isn't in general appropriate to include mocks in the main = Spring codebase, I guess this is a different case: Those mocks are = specifically provided to ease testing of Spring web contexts (like = XmlWebApplicationContext or StaticWebApplicationContext that need a = ServletContext) and controllers (the Controller.handleRequest method = needs an HttpServletRequest and an HttpServletResponse). Including them = in the standard distribution would also indicate our strong focus on = testability. The new MockServletContext implementation uses the = org.springframework.core.io.Resource API for resource loading, to allow = for ServletContext.getResourceAsStream from any resource base. So = partly, the mock implementations depend on low-level Spring API. We = could of course keep the mocks in a separate part of the Spring CVS, but = it's just about a couple of classes, thus hardly worth a separate source = tree. IMO, the main concern regarding additions to the main Spring codebase is = whether those additions can potentially grow significantly: While = Keith's rules API in the sandbox has definite potential there (so had = Ben Alex' security framework that became the Acegi Security System), the = recent Struts support classes and those Servlet API mocks will at best = see slight refinements but certainly not exponential growth. So the = former seems like a candidate for a separate module to me, while the = latter should fit into the main Spring codebase. An important point to consider is that there are simply no mocks = necessary for testing most parts of a typical Spring app, respectively = just interfaces that can conveniently be mocked in a dynamic fashion = with EasyMock. There are just two exceptions, as far I see: Our = SimpleNamingContext stuff eases custom JNDI environments, and the newly = refined set of Servlet API mocks allows for convenient testing of Spring = web MVC (and web contexts). Mocking an EJB container is next to impossible, so that's not worth = further consideration. JDBC can quite nicely be mocked with EasyMock; = it's preferable to use the JdbcOperations interface as far as possible, = though. Same for a Hibernate Session, with HibernateOperations being = preferable. It's more or less just the Servlet API that's really tedious = to mock with EasyMock, due to all those interdependent methods (e.g. URL = paths, parameters, attributes). What does everybody think? Does anyone mind including those polished = Servlet API mocks in the main Spring codebase, already for 1.0.2? Any = suggestions for alternatives? Juergen -----Original Message-----=20 From: spr...@li...=20 [mailto:spr...@li...]On Behalf Of=20 Matt Raible=20 Sent: Saturday, April 24, 2004 2:02 PM=20 To: spr...@li...=20 Subject: Re: [Springframework-user] Testing Controllers and=20 FormControllers=20 I use StrutsTestCase (http://strutstestcase.sf.net), which allows you =20 to write very little code to test an Action. Here is a simple example =20 of testing an "execute" method:=20 package org.appfuse.webapp.action;=20 import servletunit.struts.CactusStrutsTestCase;=20 import org.appfuse.Constants;=20 public class PersonActionTest extends CactusStrutsTestCase {=20 =20 public PersonActionTest(String name) {=20 super(name);=20 }=20 public void testExecute() {=20 // test execute method=20 setRequestPathInfo("/editPerson");=20 addRequestParameter("id", "1");=20 actionPerform();=20 verifyNoActionErrors();=20 assertNotNull(getRequest().getAttribute(Constants.PERSON_KEY)); = }=20 public static void main(String[] args) {=20 junit.textui.TestRunner.run(PersonActionTest.class);=20 }=20 }=20 Since CactusStrutsTestCase extends from Cactus, I can also use Cactus's = FormAuthentication support to mimic container-managed authentication.=20 To test a "Save" is also pretty simple.=20 public void testSave() throws Exception {=20 setRequestPathInfo("/editPerson");=20 addRequestParameter("action", "Edit");=20 addRequestParameter("id", "1");=20 actionPerform();=20 assertTrue(getRequest().getAttribute(Constants.PERSON_KEY) !=3D = =20 null);=20 setRequestPathInfo("/savePerson");=20 addRequestParameter("action", "Save");=20 actionPerform();=20 verifyForward("edit");=20 verifyNoActionErrors();=20 }=20 I think you have something similar to this with the Mock Object you're =20 using in Spring. It just needs to be packaged up as a JAR. I'll be =20 more than happy to write up some documentation on how to use it.=20 Matt=20 On Apr 24, 2004, at 4:27 AM, j=FCrgen h=F6ller [werk3AT] wrote:=20 > Matt,=20 >=20 > I just tried using MockHttpServletRequest and MockHttpServletResponse = > from MockObjects with a Spring FormController. Unfortunately, those =20 > MockObjects mocks are really not well-suited for testing here, as it's = =20 > so much hassle to setup any kind of HttpServletRequest method access. = > What request/response mocks do you use for testing Struts Actions?=20 >=20 > Juergen=20 >=20 >=20 > ________________________________=20 >=20 > Von: spr...@li... im Auftrag von =20 > j=FCrgen h=F6ller [werk3AT]=20 > Gesendet: Sa 24.04.2004 10:57=20 > An: spr...@li...=20 > Betreff: Re: [Springframework-user] Testing Controllers and =20 > FormControllers=20 >=20 >=20 >=20 > I don't see much difference between testing Controllers and =20 > FormControllers: Both share the same "ModelAndView =20 > handleRequest(HttpServletRequest, HttpServletResponse)" method that =20 > you need to invoke for testing. As of 1.0.1, you shouldn't need a =20 > ServletContext mock anymore (except when actually accessing the =20 > ServletContext), so all you need are HttpServletRequest and =20 > HttpServletResponse mocks. The mocks provided by the MockObjects =20 > project should be fine for this.=20 >=20 > Juergen=20 >=20 >=20 > ________________________________=20 >=20 > Von: spr...@li... im Auftrag von =20 > Matt Raible=20 > Gesendet: Fr 23.04.2004 20:48=20 > An: spr...@li...=20 > Betreff: [Springframework-user] Testing Controllers and = FormControllers=20 >=20 >=20 >=20 > I've found it pretty simple to test Controllers, but FormControllers =20 > are=20 > a different story. From looking at the FormControllerTestSuite (URL=20 > below), as well as many other Spring tests, it seems that a lot of=20 > internal mocks are used to test this stuff.=20 >=20 > So my question is - what do you recommend for the average Spring MVC=20 > person? What is the strategy we should be using to test our=20 > controllers? Should we be using the Mocks that Spring provides? This = > would certainly make things easier. If we're supposed to do that - is = > it possible to get these mocks distributed in a JAR?=20 >=20 > Thanks,=20 >=20 > Matt=20 >=20 > http://monkeymachine.co.uk/spring/xref-test/org/springframework/web/=20 > serv=20 > let/mvc/FormControllerTestSuite.html=20 >=20 >=20 >=20 >=20 > -------------------------------------------------------=20 > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek=20 > For a limited time only, get FREE Ground shipping on all orders of $35 = > or more. Hurry up and shop folks, this offer expires April 30th!=20 > http://www.thinkgeek.com/freeshipping/?cpg=3D12297=20 > _______________________________________________=20 > Springframework-user mailing list=20 > Spr...@li...=20 > https://lists.sourceforge.net/lists/listinfo/springframework-user=20 >=20 >=20 >=20 >=20 > -------------------------------------------------------=20 > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek=20 > For a limited time only, get FREE Ground shipping on all orders of $35 = > or more. Hurry up and shop folks, this offer expires April 30th!=20 > http://www.thinkgeek.com/freeshipping/?cpg=12297=20 > _______________________________________________=20 > Springframework-user mailing list=20 > Spr...@li...=20 > https://lists.sourceforge.net/lists/listinfo/springframework-user=20 >=20 >=20 >=20 >=20 > -------------------------------------------------------=20 > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek=20 > For a limited time only, get FREE Ground shipping on all orders of $35 = > or more. Hurry up and shop folks, this offer expires April 30th!=20 > http://www.thinkgeek.com/freeshipping/?cpg=12297=20 > _______________________________________________=20 > Springframework-user mailing list=20 > Spr...@li...=20 > https://lists.sourceforge.net/lists/listinfo/springframework-user=20 -------------------------------------------------------=20 This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek=20 For a limited time only, get FREE Ground shipping on all orders of $35=20 or more. Hurry up and shop folks, this offer expires April 30th!=20 http://www.thinkgeek.com/freeshipping/?cpg=12297=20 _______________________________________________=20 Springframework-user mailing list=20 Spr...@li...=20 https://lists.sourceforge.net/lists/listinfo/springframework-user=20 |
|
From: James C. <jim...@do...> - 2004-04-27 16:37:48
|
I too like Colin's proposed syntax. It would be slightly more in line = with the Java Map to change <complexentry> to <mapentry>. > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On = Behalf > Of Colin Sampaleanu > Sent: Tuesday, April 27, 2004 9:59 AM > To: spr...@li... > Subject: Re: [Springframework-developer] non-String keys for map = entries >=20 > I agree it would be very good to have. I've been hit a few times by = the > lack. >=20 > I am ok with your syntax, given that probably most of the uses will > still be the simple case. An alternative would be to have another kind > of entry allowed >=20 > <map> > <complexentry> > <key> > <ref bean=3D"myKey"/> > </key> > <value> > <ref bean=3D"myTarget"/> > </value> > </complexentry> > </map> >=20 > 'complexentry' is just a name I came up with now. I don't really like = it > or think it that suitable... >=20 > Colin >=20 >=20 > j=FCrgen h=F6ller [werk3AT] wrote: >=20 > >A colleague of mine just suggested that <entry> tags in XML bean > definitions should also support non-String keys: After all, a > java.util.Map can take any Object as key. > > > >So instead of just the current: > > > ><map> > > <entry key=3D"myKey"> > > <ref bean=3D"myTarget"/> > > </entry> > ></map> > > > >We could also support something like the following: > > > ><map> > > <entry> > > <key> > > <ref bean=3D"myKey"/> > > </key> > > <ref bean=3D"myTarget"/> > > </entry> > ></map> > > > >The problem is the syntax: It looks odd to have the <ref> Map value = at > the same level as the <key> subtag, with the latter having a nested = <ref> > again... > > > >Any ideas? > > > >Juergen > > > > > >DI J=FCrgen H=F6ller > >Senior System Architect > >______________________________________ > > > >werk3ATS - division systementwicklung > >werk3AT informations- und mediensysteme > > > >europaplatz 4 > >A - 4020 linz > > > >t. +43 (0) 732 71 65 29 502 > >f. +43 (0) 732 71 65 29 3 > >mailto:jue...@we... > >http://www.werk3at.com > >______________________________________ > >werk3ATS - WIR ENTWICKELN ERFOLG > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > >For a limited time only, get FREE Ground shipping on all orders of = $35 > >or more. Hurry up and shop folks, this offer expires April 30th! > >http://www.thinkgeek.com/freeshipping/?cpg=12297 > >_______________________________________________ > >Springframework-developer mailing list > >Spr...@li... > = >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Matt R. <li...@ra...> - 2004-04-27 16:23:09
|
Doh - spoke to soon. It seems like the following is failing in the
JavaScriptValidatorTag:
private ValidatorResources getValidatorResources() {
ListableBeanFactory lbf =3D WebApplicationContextUtils
=20
.getRequiredWebApplicationContext(pageContext.getServletContext());
ValidatorFactory factory =3D (ValidatorFactory)
BeanFactoryUtils
.beanOfTypeIncludingAncestors(lbf,
ValidatorFactory.class, true, true);
return factory.getValidatorResources();
}
I'm getting the following error now:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
unique bean of type
[org.springframework.validation.commons.ValidatorFactory] is defined:
Expected single bean but found 0
=09
org.springframework.beans.factory.BeanFactoryUtils.beanOfTypeIncludingAn
cestors(BeanFactoryUtils.java:147)
=09
org.springframework.validation.commons.taglib.JavascriptValidatorTag.get
ValidatorResources(JavascriptValidatorTag.java:773)
=09
org.springframework.validation.commons.taglib.JavascriptValidatorTag.doS
tartTag(JavascriptValidatorTag.java:346)
=09
org.apache.jsp.scripts.validator_jsp._jspx_meth_html_javascript_0(valida
tor_jsp.java:78)
=09
org.apache.jsp.scripts.validator_jsp._jspService(validator_jsp.java:55)
=09
Maybe my validatorFactory syntax is wrong?
<bean id=3D"validatorFactory"
class=3D"org.springframework.validation.commons.DefaultValidatorFactory" =
init-method=3D"init">
<property name=3D"resources">
<list>
=09
<value>WEB-INF/validator-rules.xml</value>
<value>WEB-INF/validation.xml</value>
</list>
</property>
</bean>
BTW, I also had to change "spring-commons-validator.tld" to *not*
require formName:
<attribute>
<name>formName</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
This is how Struts does it and its necessary to make a standalone
JavaScript/JSP work.
Thanks,
Matt
> -----Original Message-----
> From: Matt Raible [mailto:li...@ra...]=20
> Sent: Tuesday, April 27, 2004 9:26 AM
> To: 'spr...@li...'
> Subject: RE: [Springframework-developer] [Commons Validator]=20
> Error on Startup
>=20
>=20
> Thanks Keith - problem fixed!
>=20
> Matt
>=20
> > -----Original Message-----
> > From: spr...@li...
> > [mailto:spr...@li...]
> > On Behalf Of Keith Donald
> > Sent: Tuesday, April 27, 2004 8:30 AM
> > To: spr...@li...
> > Subject: RE: [Springframework-developer] [Commons Validator]=20
> > Error on Startup
> >=20
> >=20
> > ValidatorFactory is now a interface - DefaultValidatorFactory
> > is the implementation. Daniel made it an interface to be a=20
> > bit more flexible for those who had custom validation-xml=20
> > loading requirements.
> >=20
> > Keith
> >=20
> > -----Original Message-----
> > From: spr...@li...
> > [mailto:spr...@li...]
> > On Behalf Of Matt Raible
> > Sent: Tuesday, April 27, 2004 2:51 AM
> > To: spr...@li...
> > Subject: [Springframework-developer] [Commons Validator]
> > Error on Startup
> >=20
> >=20
> > I grabbed a fresh checkout from CVS tonight, expecting that
> > the commons validator stuff still worked. Unfortunately,=20
> > (from what I can tell) it does not. Here's the error I get=20
> > on startup:
> >=20
> > ERROR - FrameworkServlet.initServletBean(207) | Context
> > initialization failed
> > org.springframework.beans.factory.BeanDefinitionStoreException
> > : Error registering bean with name 'va lidatorFactory'=20
> > defined in resource [/WEB-INF/action-servlet.xml] of
> > ServletContext: Validation of b
> > ean definition with name failed; nested exception is=20
> > org.springframework.beans.factory.support.BeanD
> > efinitionValidationException: No public constructor in class=20
> > [interface org.springframework.validati=20
> > on.commons.ValidatorFactory]=20
> > org.springframework.beans.factory.support.BeanDefinitionValida
> > tionExcept
> > ion: No public constructor i
> > n class [interface=20
> > org.springframework.validation.commons.ValidatorFactory]
> > at=20
> > org.springframework.beans.factory.support.RootBeanDefinition.v
> > alidate(Ro
> > otBeanDefinition.
> > java:334)
> > at=20
> > org.springframework.beans.factory.support.DefaultListableBeanF
> > actory.reg
> > isterBeanDefiniti
> > on(DefaultListableBeanFactory.java:194)
> > at=20
> > org.springframework.beans.factory.xml.DefaultXmlBeanDefinition
> > Parser.loa
> > dBeanDefinition(D
> > efaultXmlBeanDefinitionParser.java:214)
> > at=20
> > org.springframework.beans.factory.xml.DefaultXmlBeanDefinition
> > Parser.reg
> > isterBeanDefiniti
> > ons(DefaultXmlBeanDefinitionParser.java:152)
> > at=20
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.
> > registerBe
> > anDefinitions(Xml
> > BeanDefinitionReader.java:161)
> > at=20
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.
> > loadBeanDe
> > finitions(XmlBean
> > DefinitionReader.java:127)
> >=20
> > ----------------------------------------
> >=20
> > Here's my config:
> >=20
> > <bean id=3D"validatorFactory"
> > class=3D"org.springframework.validation.commons.ValidatorFactory"=20
> > init-method=3D"init">
> > <property name=3D"resources">
> > <list>
> > =09
> > <value>WEB-INF/validator-rules.xml</value>
> > <value>WEB-INF/validation.xml</value>
> > </list>
> > </property>
> > </bean>
> >=20
> > <bean id=3D"beanValidator"
> > class=3D"org.springframework.validation.commons.BeanValidator">
> > <property name=3D"validatorFactory"><ref=20
> > local=3D"validatorFactory"/></property>
> > </bean>
> >=20
> > Any ideas?
> >=20
> > Thanks,
> >=20
> > Matt
> >=20
> >=20
> >=20
> >=20
> > -------------------------------------------------------
> > This SF.net email is sponsored by: The Robotic Monkeys at
> > ThinkGeek For a limited time only, get FREE Ground shipping=20
> > on all orders of $35 or more. Hurry up and shop folks, this=20
> > offer expires April 30th!=20
> > http://www.thinkgeek.com/freeshipping/?cpg=3D> 12297
> >=20
> > _______________________________________________
> >=20
> > Springframework-developer mailing list
> > Spr...@li...
> >=20
> https://lists.sourceforge.net/lists/listinfo/s>
pringframework-developer
> >=20
> >=20
> >=20
> > -------------------------------------------------------
> > This SF.net email is sponsored by: The Robotic Monkeys at
> > ThinkGeek For a limited time only, get FREE Ground shipping=20
> > on all orders of $35 or more. Hurry up and shop folks, this=20
> > offer expires April 30th!=20
> > http://www.thinkgeek.com/freeshipping/?cpg=12297
> >=20
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> >=20
> https://lists.sourceforge.net/lists/listinfo/s>
pringframework-developer
> >=20
>=20
|
|
From: Matt R. <li...@ra...> - 2004-04-27 15:26:54
|
Thanks Keith - problem fixed! Matt > -----Original Message----- > From: spr...@li...=20 > [mailto:spr...@li...] > On Behalf Of Keith Donald > Sent: Tuesday, April 27, 2004 8:30 AM > To: spr...@li... > Subject: RE: [Springframework-developer] [Commons Validator]=20 > Error on Startup >=20 >=20 > ValidatorFactory is now a interface - DefaultValidatorFactory=20 > is the implementation. Daniel made it an interface to be a=20 > bit more flexible for those who had custom validation-xml=20 > loading requirements. >=20 > Keith >=20 > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] > On Behalf Of Matt Raible > Sent: Tuesday, April 27, 2004 2:51 AM > To: spr...@li... > Subject: [Springframework-developer] [Commons Validator]=20 > Error on Startup >=20 >=20 > I grabbed a fresh checkout from CVS tonight, expecting that=20 > the commons validator stuff still worked. Unfortunately,=20 > (from what I can tell) it does not. Here's the error I get=20 > on startup: >=20 > ERROR - FrameworkServlet.initServletBean(207) | Context=20 > initialization failed > org.springframework.beans.factory.BeanDefinitionStoreException > : Error registering bean with name 'va lidatorFactory'=20 > defined in resource [/WEB-INF/action-servlet.xml] of > ServletContext: Validation of b > ean definition with name failed; nested exception is=20 > org.springframework.beans.factory.support.BeanD > efinitionValidationException: No public constructor in class=20 > [interface org.springframework.validati=20 > on.commons.ValidatorFactory]=20 > org.springframework.beans.factory.support.BeanDefinitionValida > tionExcept > ion: No public constructor i > n class [interface=20 > org.springframework.validation.commons.ValidatorFactory] > at=20 > org.springframework.beans.factory.support.RootBeanDefinition.v > alidate(Ro > otBeanDefinition. > java:334) > at=20 > org.springframework.beans.factory.support.DefaultListableBeanF > actory.reg > isterBeanDefiniti > on(DefaultListableBeanFactory.java:194) > at=20 > org.springframework.beans.factory.xml.DefaultXmlBeanDefinition > Parser.loa > dBeanDefinition(D > efaultXmlBeanDefinitionParser.java:214) > at=20 > org.springframework.beans.factory.xml.DefaultXmlBeanDefinition > Parser.reg > isterBeanDefiniti > ons(DefaultXmlBeanDefinitionParser.java:152) > at=20 > org.springframework.beans.factory.xml.XmlBeanDefinitionReader. > registerBe > anDefinitions(Xml > BeanDefinitionReader.java:161) > at=20 > org.springframework.beans.factory.xml.XmlBeanDefinitionReader. > loadBeanDe > finitions(XmlBean > DefinitionReader.java:127) >=20 > ---------------------------------------- >=20 > Here's my config: >=20 > <bean id=3D"validatorFactory"=20 > class=3D"org.springframework.validation.commons.ValidatorFactory"=20 > init-method=3D"init"> > <property name=3D"resources"> > <list> > =09 > <value>WEB-INF/validator-rules.xml</value> > <value>WEB-INF/validation.xml</value> > </list> > </property> > </bean> >=20 > <bean id=3D"beanValidator"=20 > class=3D"org.springframework.validation.commons.BeanValidator"> > <property name=3D"validatorFactory"><ref=20 > local=3D"validatorFactory"/></property> > </bean> >=20 > Any ideas? >=20 > Thanks, >=20 > Matt >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at=20 > ThinkGeek For a limited time only, get FREE Ground shipping=20 > on all orders of $35 or more. Hurry up and shop folks, this=20 > offer expires April 30th!=20 > http://www.thinkgeek.com/freeshipping/?cpg=3D> 12297 >=20 > _______________________________________________ >=20 > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at=20 > ThinkGeek For a limited time only, get FREE Ground shipping=20 > on all orders of $35 or more. Hurry up and shop folks, this=20 > offer expires April 30th!=20 > http://www.thinkgeek.com/freeshipping/?cpg=12297 >=20 > _______________________________________________ > Springframework-developer mailing list=20 > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer >=20 |