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: Dmitriy K. <dko...@ru...> - 2004-10-05 12:28:09
|
Juergen,
this would work perfectly as well!!! Can you commit this or do you want
me to do it?
Thanks,
Dmitriy.
jürgen höller [werk3AT] wrote:
>Dmitriy,
>
>I wouldn't build generic string trimming capability into DataBinder itself: We already have StringTrimmerEditor for this, which can be registered as custom editor.
>
>That said, I do see your use case for required fields. What about redefining required fields to accept empty strings? I.e. to change the required check as follows:
>
> if (pv == null || pv.getValue() == null ||
> (pv.getValue() instanceof String && !StringUtils.hasText((String) pv.getValue()))) {
>
>I consider redefining the required check like this, without an extra config property. IMO, this is sensible for a required check anyway, from a semantic point of view...
>
>Juergen
>
>
>________________________________
>
>Von: spr...@li... im Auftrag von Dmitriy Kopylenko
>Gesendet: Di 05.10.2004 05:00
>An: spr...@li...
>Betreff: [Springframework-developer] Small change in DataBinder's bind() behavior
>
>
>Juergen,
>
>I was browsing the source for DataBinder and co. and playing with "required fields" functionality and DataBinder's tests and I've noticed the following - it's not possible to configure the DataBinder to trim the unwanted spaces from the required fields. Consider the following test case:
>
>TestBean alef = new TestBean();
>DataBinder binder = new DataBinder(alef, "person");
>binder.setRequiredFields(new String[]{"name", "touchy", "date"});
>
>MutablePropertyValues pvs = new MutablePropertyValues();
>pvs.addPropertyValue(new PropertyValue("touchy", " "));
>pvs.addPropertyValue(new PropertyValue("name", null));
>
>binder.bind(pvs);
>
>BindException ex = binder.getErrors();
>assertEquals("Wrong amount of errors", 3, ex.getErrorCount());
>
>This will fail because it will not recognize required "touchy" field as not being present because it contains spaces. It would really be nice to control trimming of such "accidentally set spaces" for required fields so the bind() method could then treat them as "missing required field".
>
>I've added the flag to DataBinder ("trimSpacesInStringFields") and small piece of logic in DataBinder.bind(PropertyValues):
>
>// check for missing fields
> if (this.requiredFields != null) {
> for (int i = 0; i < this.requiredFields.length; i++) {
> PropertyValue pv = pvs.getPropertyValue(this.requiredFields[i]);
>
> //This is what I added
> if(this.trimSpacesInStringFields && pv != null && pv.getValue() != null && pv.getValue() instanceof String) {
> pv = new PropertyValue(pv.getName(), ((String)pv.getValue()).trim());
> }
>
> if (pv == null || "".equals(pv.getValue()) || pv.getValue() == null) {
> // create field error with code "required"
> String field = this.requiredFields[i];
> this.errors.addError(
> new FieldError(this.errors.getObjectName(), field, "", true,
> this.errors.resolveMessageCodes(MISSING_FIELD_ERROR_CODE, field),
> getArgumentsForBindingError(field), "Field '" + field + "' is required"));
> }
> }
> }
>...// the rest is omitted
>
>Then by modifying test case a little, it works perfectly:
>
> TestBean alef = new TestBean();
>
> DataBinder binder = new DataBinder(alef, "person");
> binder.setRequiredFields(new String[]{"name", "touchy", "date"});
>
> //Set the new flag
> binder.setTrimSpacesInStringFields(true);
>
> MutablePropertyValues pvs = new MutablePropertyValues();
> pvs.addPropertyValue(new PropertyValue("touchy", " "));
> pvs.addPropertyValue(new PropertyValue("name", null));
>
> binder.bind(pvs);
>
> BindException ex = binder.getErrors();
> System.out.println(alef.getTouchy().length());
> System.out.println(ex);
> assertEquals("Wrong amount of errors", 3, ex.getErrorCount());
>
>I think it would be a very handy feature (for us at least), unless I missed something fundamental.
>
>Thoughts?
>
>Regards,
>Dmitriy.
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
>Use IT products in your business? Tell us what you think of them. Give us
>Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
>http://productguide.itmanagersjournal.com/guidepromo.tmpl
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: B. <jer...@xt...> - 2004-10-05 11:56:24
|
Hi, I created a new topic on the forums regarding ChoiceFormat (http://forum.springframework.org/viewtopic.php?p=3D4748#4748) but am not= sure this is the best place to discuss this issue as there is obviously no sup= port yet for what I'm asking for. Basically I think that adding the following two methods in the MessageSou= rce interfaces might help: String getMessage(String code, Format[] formats, Object[] args, Locale lo= cale) String getMessage(String code, Format[] formats, Object[] args, String defaultMessage, Locale locale) Any comment on this issue? Regards, J=E9r=F4me. |
|
From: <jue...@we...> - 2004-10-05 07:15:41
|
Dmitriy,
=20
I wouldn't build generic string trimming capability into DataBinder =
itself: We already have StringTrimmerEditor for this, which can be =
registered as custom editor.
=20
That said, I do see your use case for required fields. What about =
redefining required fields to accept empty strings? I.e. to change the =
required check as follows:
=20
if (pv =3D=3D null || pv.getValue() =3D=3D null ||
(pv.getValue() instanceof String && !StringUtils.hasText((String) =
pv.getValue()))) {
I consider redefining the required check like this, without an extra =
config property. IMO, this is sensible for a required check anyway, from =
a semantic point of view...
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Dmitriy Kopylenko
Gesendet: Di 05.10.2004 05:00
An: spr...@li...
Betreff: [Springframework-developer] Small change in DataBinder's bind() =
behavior
Juergen,
I was browsing the source for DataBinder and co. and playing with =
"required fields" functionality and DataBinder's tests and I've noticed =
the following - it's not possible to configure the DataBinder to trim =
the unwanted spaces from the required fields. Consider the following =
test case:
TestBean alef =3D new TestBean();
DataBinder binder =3D new DataBinder(alef, "person");
binder.setRequiredFields(new String[]{"name", "touchy", "date"});
MutablePropertyValues pvs =3D new MutablePropertyValues();
pvs.addPropertyValue(new PropertyValue("touchy", " "));
pvs.addPropertyValue(new PropertyValue("name", null));
binder.bind(pvs);
BindException ex =3D binder.getErrors();
assertEquals("Wrong amount of errors", 3, ex.getErrorCount());
This will fail because it will not recognize required "touchy" field as =
not being present because it contains spaces. It would really be nice to =
control trimming of such "accidentally set spaces" for required fields =
so the bind() method could then treat them as "missing required field".
I've added the flag to DataBinder ("trimSpacesInStringFields") and small =
piece of logic in DataBinder.bind(PropertyValues):
// check for missing fields
if (this.requiredFields !=3D null) {
for (int i =3D 0; i < this.requiredFields.length; i++) {
PropertyValue pv =3D =
pvs.getPropertyValue(this.requiredFields[i]);
=20
//This is what I added
if(this.trimSpacesInStringFields && pv !=3D null && =
pv.getValue() !=3D null && pv.getValue() instanceof String) {
pv =3D new PropertyValue(pv.getName(), =
((String)pv.getValue()).trim());
}
=20
if (pv =3D=3D null || "".equals(pv.getValue()) || =
pv.getValue() =3D=3D null) {
// create field error with code "required"
String field =3D this.requiredFields[i];
this.errors.addError(
new FieldError(this.errors.getObjectName(), =
field, "", true,
=
this.errors.resolveMessageCodes(MISSING_FIELD_ERROR_CODE, field),
getArgumentsForBindingError(field), "Field =
'" + field + "' is required"));
}
}
}
...// the rest is omitted
Then by modifying test case a little, it works perfectly:
TestBean alef =3D new TestBean();
DataBinder binder =3D new DataBinder(alef, "person");
binder.setRequiredFields(new String[]{"name", "touchy", =
"date"});
=20
//Set the new flag
binder.setTrimSpacesInStringFields(true);
MutablePropertyValues pvs =3D new MutablePropertyValues();
pvs.addPropertyValue(new PropertyValue("touchy", " "));
pvs.addPropertyValue(new PropertyValue("name", null));
binder.bind(pvs);
BindException ex =3D binder.getErrors();
System.out.println(alef.getTouchy().length());
System.out.println(ex);
assertEquals("Wrong amount of errors", 3, ex.getErrorCount());
I think it would be a very handy feature (for us at least), unless I =
missed something fundamental.
Thoughts?
Regards,
Dmitriy.
|
|
From: <jue...@we...> - 2004-10-05 07:06:02
|
Well, effectively we already *have* a built-in kind of expression = language: BeanWrapper's property path evaluation capabilities, roughly = following JSTL EL syntax. All that PropertyPathFactoryBean does is = evaluate such BeanWrapper-style property paths on a given target bean. =20 I guess that's as convenient as you can get without the BeanFactory = knowing about what's going on here (i.e. without the core factory = knowing about expressions). =20 Regarding constants: Since 1.1 RC2, we have a FieldRetrievingFactoryBean = which can be used to retrieve static fields: // standard definition for exposing a static field, specifying the = "staticField" property <bean id=3D"myField" = class=3D"org.springframework.beans.factory.config.FieldRetrievingFactoryB= ean"> <property = name=3D"staticField"><value>java.sql.Connection.TRANSACTION_SERIALIZABLE<= /value></property> </bean> // convenience version that specifies a static field pattern as bean = name (since 1.1.2) <bean id=3D"java.sql.Connection.TRANSACTION_SERIALIZABLE" = class=3D"org.springframework.beans.factory.config.FieldRetrievingFactoryB= ean"/> If it's just about the odd constant in your XML bean definitions, this = should be good enough. Of course, full-fledged scripting support *is* = desirable for needs that go beyond that: for example, to specify entire = bean definitions in scripts. I see those as two different goals, though. Juergen ________________________________ Von: spr...@li... im Auftrag = von Rod Johnson Gesendet: Mo 04.10.2004 22:51 An: spr...@li... Betreff: RE: [Springframework-developer] PropertyPathFactoryBean Have to say that this looks to me like it's making a case for an = expression language instead of a FactoryBean. A similar requirement that would also be well addressed by = OGNL/whatever: evaluating a constant. E.g. an AutowireCapableBeanFactory constant, = which I recently had to configure via a property. It would be nice to be able to = do that easily. Rgds Rod -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Colin Sampaleanu Sent: 04 October 2004 18:32 To: spr...@li... Subject: Re: [Springframework-developer] PropertyPathFactoryBean Good stuff. It overlaps of course with the mythical OGNL or expression support which keeps getting pushed back, but in the meantime provides = some of the benefits for pretty little extra code... j=FCrgen h=F6ller [werk3AT] wrote: >I've just added a PropertyPathFactoryBean, following this suggestion: > >http://opensource.atlassian.com/projects/spring/browse/SPR-343 > > >Usage examples: > > // target bean to be referenced by name <bean id=3D"tb" > class=3D"org.springframework.beans.TestBean" singleton=3D"false"> > <property name=3D"age"><value>10</value></property> > <property name=3D"spouse"> > <bean class=3D"org.springframework.beans.TestBean"> > <property name=3D"age"><value>11</value></property> > </bean> > </property> > </bean> > > // will result in 12, which is the value of property 'age' of the > inner bean <bean id=3D"propertyPath1" class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "> > <property name=3D"targetObject"> > <bean class=3D"org.springframework.beans.TestBean"> > <property name=3D"age"><value>12</value></property> > </bean> > </property> > <property name=3D"propertyPath"><value>age</value></property> > </bean> > > // will result in 11, which is the value of property 'spouse.age' of = bean 'tb' > <bean id=3D"propertyPath2" class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "> > <property name=3D"targetBeanName"><value>tb</value></property> > <property name=3D"propertyPath"><value>spouse.age</value></property> > </bean> > > // will result in 10, which is the value of property 'age' of bean = 'tb' > <bean id=3D"tb.age" > = class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBea > n"/> > > >The last one, interpreting the bean name as 'beanName.property' = pattern, is quite concise... >=20 > ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal = Use IT products in your business? Tell us what you think of them. Give us = Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give = us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out = more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Dmitriy K. <dko...@ru...> - 2004-10-05 02:01:46
|
Juergen,
I was browsing the source for DataBinder and co. and playing with
"required fields" functionality and DataBinder's tests and I've noticed
the following - it's not possible to configure the DataBinder to trim
the unwanted spaces from the required fields. Consider the following
test case:
TestBean alef = new TestBean();
DataBinder binder = new DataBinder(alef, "person");
binder.setRequiredFields(new String[]{"name", "touchy", "date"});
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.addPropertyValue(new PropertyValue("touchy", " "));
pvs.addPropertyValue(new PropertyValue("name", null));
binder.bind(pvs);
BindException ex = binder.getErrors();
assertEquals("Wrong amount of errors", 3, ex.getErrorCount());
This will fail because it will not recognize required "touchy" field as
not being present because it contains spaces. It would really be nice to
control trimming of such "accidentally set spaces" for required fields
so the bind() method could then treat them as "missing required field".
I've added the flag to DataBinder ("trimSpacesInStringFields") and small
piece of logic in DataBinder.bind(PropertyValues):
// check for missing fields
if (this.requiredFields != null) {
for (int i = 0; i < this.requiredFields.length; i++) {
PropertyValue pv =
pvs.getPropertyValue(this.requiredFields[i]);
//This is what I added
* if(this.trimSpacesInStringFields && pv != null &&
pv.getValue() != null && pv.getValue() instanceof String) {
pv = new PropertyValue(pv.getName(),
((String)pv.getValue()).trim());
}*
if (pv == null || "".equals(pv.getValue()) ||
pv.getValue() == null) {
// create field error with code "required"
String field = this.requiredFields[i];
this.errors.addError(
new FieldError(this.errors.getObjectName(),
field, "", true,
this.errors.resolveMessageCodes(MISSING_FIELD_ERROR_CODE, field),
getArgumentsForBindingError(field), "Field
'" + field + "' is required"));
}
}
}
...// the rest is omitted
Then by modifying test case a little, it works perfectly:
TestBean alef = new TestBean();
DataBinder binder = new DataBinder(alef, "person");
binder.setRequiredFields(new String[]{"name", "touchy", "date"});
*//Set the new flag
binder.setTrimSpacesInStringFields(true);*
MutablePropertyValues pvs = new MutablePropertyValues();
pvs.addPropertyValue(new PropertyValue("touchy", " "));
pvs.addPropertyValue(new PropertyValue("name", null));
binder.bind(pvs);
BindException ex = binder.getErrors();
System.out.println(alef.getTouchy().length());
System.out.println(ex);
assertEquals("Wrong amount of errors", 3, ex.getErrorCount());
I think it would be a very handy feature (for us at least), unless I
missed something fundamental.
Thoughts?
Regards,
Dmitriy.
|
|
From: Nick L. <nic...@es...> - 2004-10-05 01:16:40
|
> > > On Mon, October 4, 2004 15:10, Colin Sampaleanu said: > > > From what you're saying it sounds like it doesn't make > sense to put it > > into the sandbox on the basis that FOP is immature. > > Hi Colin, > > you replied to my post but I'm unsure if this is directed at > me or Juergen..? > > If me, then in my opinion FOP itself is not that immature - > their choice of > version number is simply inappropriate. FOP has been in > fairly widespread use > for well over 3 years now. > We have used FOP fairly extensivly in the past, and I would have to disagree about it's maturity. We had a fair bit of trouble with its dependancies - from memory it required a specific version of batik, which in turn required a specific version of Xerces. This might have been fixed in the over the last year - I'm just relaying my experiences. Nick |
|
From: Colin S. <col...@ex...> - 2004-10-04 23:51:36
|
Unless I'm missing something, looks like the docs don't really get into
this area. I've updated the documentation TODO Jira entry with the
following note:
"""
There seems to be a general hole in the MVC docs w/regards to data
binding of form params to command objects, in terms of real details on
the mechanism, details for the format coming in, and details on how
exceptions and error codes (typeMismatch, etc.) can get mapped to
messages that get pulled out of the 'messages' bean, so users don't see
raw exceptions. Some of thee details may currently be obtained by
looking at some JavaDocs or source for classes like
BaseCommandController, DefaultMessageCodeResolver, DataBinder,
TypeMismatchException, and MethodInvocationException.
"""
Dmitriy Kopylenko wrote:
> Ben,
>
> you don't need to do anything special here. Simply provide a custom
> message in "messages.properties" found in the classpath for a
> "typeMismatch.{property_name} key and Spring will take care of the
> rest i.e.
>
> typeMismatch.luhn=A valid Luhn is required
>
> Also don't forget to configure the MessageSource bean in your app
> context with base name of "messages":
>
> <!-- Message source for this context, loaded from localized
> "messages_xx" files -->
> <bean id="messageSource"
> class="org.springframework.context.support.ResourceBundleMessageSource">
> <property name="basename"><value>messages</value></property>
> </bean>
>
> Take a look at Petclinic's example.
>
> Cheers,
> Dmitriy.
>
>
> Ben Alex wrote:
>
>> I'm using SimpleFormController to process a form containing a
>> parameter that is converted to a Long value in the form backing
>> object. The Long has a check digit and thus there are both number
>> format exceptions as well as check digit related exceptions possible.
>> By default such errors will cause the following messages to be
>> displayed to the user in the errors list:
>>
>> Failed to convert property value of type [java.lang.String] to
>> required type [java.lang.Long] for property 'luhn'; nested exception
>> is java.lang.IllegalArgumentException: Cannot parse number:
>> Unparseable number: "aString"
>>
>> or
>>
>> Property 'luhn' threw exception; nested exception is
>> java.lang.IllegalArgumentException: Business key must be a valid Luhn
>> identifier
>>
>> Neither response is suitable for display to users. I would rather
>> replace these with my own more user-friendly message. One approach
>> discussed at http://forum.springframework.org/viewtopic.php?t=1098
>> (last post by ojolly) is for the PropertyEditor to set the object to
>> null, then detect something was actually entered in the request
>> parameter in onBindAndValidate and then add a friendly error. That's
>> OK, but then you lose whatever the user actually typed in as the
>> PropertyEditor set it to null. This is unacceptable as quite often
>> the data entered will be close to what it should have been (eg an
>> unwanted fractional portion for an integer, a mis-typed digit for a
>> checksum-based number, a property that is simply too long etc).
>>
>> I ended up writing a MyBindException which subclasses BindException
>> and provides these two methods:
>>
>> public void removeError(ObjectError error) {
>> this.errors.remove(error);
>> }
>> public void removeErrors(List objectErrors) {
>> Iterator iter = objectErrors.iterator();
>> while (iter.hasNext()) {
>> ObjectError objectError = (ObjectError) iter.next();
>> removeError(objectError);
>> }
>> }
>>
>> My controller then does this:
>>
>> protected void onBindAndValidate(HttpServletRequest request,
>> Object command, BindException errors) throws Exception {
>> Person person = (Person) command;
>> if (errors.hasFieldErrors("luhn")) {
>> // Cast is safe as createBinder caused MyBindException to
>> be used
>> MyBindException myErrors = (MyBindException) errors;
>> errors.rejectValue("luhn", "LUHN_INVALID", "A valid Luhn
>> is required.");
>> } ....
>>
>> This works great. It consumes the unwanted, uninformative user
>> feedback and replaces it. It also avoids needing to look at
>> HttpServetRequest parameters. The problem is to achieve this I've
>> needed to write MyBindException, copy nine methods to it (as the
>> errors List is private in the BindException superclass), write a
>> MyServletRequestDataBinder to set it up, and then override
>> createBinder in the controller to use MyServletRequestDataBinder. It
>> seems a lot of work, so I was hoping we could add the above two
>> methods to BindException? Alternatively, at least making the errors
>> List protected in BindException will save the ugly code duplication.
>>
>> Alternatively, if there's another way entirely of achieving this, I'd
>> be grateful if someone would let me know.
>>
>> Best regards
>> Ben
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
>> Use IT products in your business? Tell us what you think of them.
>> Give us
>> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find
>> out more
>> http://productguide.itmanagersjournal.com/guidepromo.tmpl
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Ben A. <ben...@ac...> - 2004-10-04 23:38:55
|
Dmitriy Kopylenko wrote:
> Ben,
>
> you don't need to do anything special here. Simply provide a custom
> message in "messages.properties" found in the classpath for a
> "typeMismatch.{property_name} key and Spring will take care of the
> rest i.e.
>
> typeMismatch.luhn=A valid Luhn is required
>
>
Hi Dmitriy
Thanks for the info - that's a lot nicer.
For the benefit of the archives, this is covered in the JavaDocs of
org.springframework.validation.DefaultMessageCodesResolver.
Cheers
Ben
|
|
From: Dmitriy K. <dko...@ru...> - 2004-10-04 23:04:17
|
Ben,
you don't need to do anything special here. Simply provide a custom
message in "messages.properties" found in the classpath for a
"typeMismatch.{property_name} key and Spring will take care of the rest i.e.
typeMismatch.luhn=A valid Luhn is required
Also don't forget to configure the MessageSource bean in your app
context with base name of "messages":
<!-- Message source for this context, loaded from localized
"messages_xx" files -->
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>
Take a look at Petclinic's example.
Cheers,
Dmitriy.
Ben Alex wrote:
> I'm using SimpleFormController to process a form containing a
> parameter that is converted to a Long value in the form backing
> object. The Long has a check digit and thus there are both number
> format exceptions as well as check digit related exceptions possible.
> By default such errors will cause the following messages to be
> displayed to the user in the errors list:
>
> Failed to convert property value of type [java.lang.String] to
> required type [java.lang.Long] for property 'luhn'; nested exception
> is java.lang.IllegalArgumentException: Cannot parse number:
> Unparseable number: "aString"
>
> or
>
> Property 'luhn' threw exception; nested exception is
> java.lang.IllegalArgumentException: Business key must be a valid Luhn
> identifier
>
> Neither response is suitable for display to users. I would rather
> replace these with my own more user-friendly message. One approach
> discussed at http://forum.springframework.org/viewtopic.php?t=1098
> (last post by ojolly) is for the PropertyEditor to set the object to
> null, then detect something was actually entered in the request
> parameter in onBindAndValidate and then add a friendly error. That's
> OK, but then you lose whatever the user actually typed in as the
> PropertyEditor set it to null. This is unacceptable as quite often the
> data entered will be close to what it should have been (eg an unwanted
> fractional portion for an integer, a mis-typed digit for a
> checksum-based number, a property that is simply too long etc).
>
> I ended up writing a MyBindException which subclasses BindException
> and provides these two methods:
>
> public void removeError(ObjectError error) {
> this.errors.remove(error);
> }
> public void removeErrors(List objectErrors) {
> Iterator iter = objectErrors.iterator();
> while (iter.hasNext()) {
> ObjectError objectError = (ObjectError) iter.next();
> removeError(objectError);
> }
> }
>
> My controller then does this:
>
> protected void onBindAndValidate(HttpServletRequest request,
> Object command, BindException errors) throws Exception {
> Person person = (Person) command;
> if (errors.hasFieldErrors("luhn")) {
> // Cast is safe as createBinder caused MyBindException to
> be used
> MyBindException myErrors = (MyBindException) errors;
> errors.rejectValue("luhn", "LUHN_INVALID", "A valid Luhn is
> required.");
> } ....
>
> This works great. It consumes the unwanted, uninformative user
> feedback and replaces it. It also avoids needing to look at
> HttpServetRequest parameters. The problem is to achieve this I've
> needed to write MyBindException, copy nine methods to it (as the
> errors List is private in the BindException superclass), write a
> MyServletRequestDataBinder to set it up, and then override
> createBinder in the controller to use MyServletRequestDataBinder. It
> seems a lot of work, so I was hoping we could add the above two
> methods to BindException? Alternatively, at least making the errors
> List protected in BindException will save the ugly code duplication.
>
> Alternatively, if there's another way entirely of achieving this, I'd
> be grateful if someone would let me know.
>
> Best regards
> Ben
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out
> more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: <al...@jt...> - 2004-10-04 22:30:37
|
<html><head>
<style>
.white { color:#FFFFFF }.index { background-color:#FFFFFF }.index-passed { =
color:#004400 }.index-failed { color:#FF0000; font-weight:bold }.index-head=
er { font-weight:bold }.link { font-family:arial,helvetica,sans-serif; font=
-size:10pt; color:#FFFFFF; text-decoration:none; }.tab-table { margin: 0em =
0em 0.5em 0em; }.tabs { font-family:arial,helvetica,sans-serif; font-size:8=
pt; color:#000000; font-weight:bold; padding: 0em 2em; background-color:#EE=
EEEE; }.tabs-link { color:#000000; text-decoration:none; }.tabs-link:visite=
d { color:#000000; text-decoration:none; }.tabs-selected { font-family:aria=
l,helvetica,sans-serif; font-size:8pt; color:#000000; font-weight:bold; pad=
ding: 0em 2em; }.tabs-selected { border: inset; }.header-title { font-famil=
y:arial,helvetica,sans-serif; font-size:12pt; color:#000000; font-weight:bo=
ld; }.header-label { font-weight:bold; }.header-data { font-family:arial,he=
lvetica,sans-serif; font-size:10pt; color:#000000; }.modifications-data { f=
ont-family:arial,helvetica,sans-serif; font-size:8pt; color:#000000; }.modi=
fications-sectionheader { background-color:#000066; font-family:arial,helve=
tica,sans-serif; font-size:10pt; color:#FFFFFF; }.modifications-oddrow { ba=
ckground-color:#CCCCCC }.modifications-evenrow { background-color:#FFFFCC }=
.changelists-oddrow { background-color:#CCCCCC }.changelists-evenrow { back=
ground-color:#FFFFCC }.changelists-file-spacer { background-color:#FFFFFF }=
.changelists-file-evenrow { background-color:#EEEEEE }.changelists-file-odd=
row { background-color:#FFFFEE }.changelists-file-header { background-color=
:#666666; font-family:arial,helvetica,sans-serif; font-size:8pt; color:#FFF=
FFF; }.compile-data { font-family:arial,helvetica,sans-serif; font-size:8pt=
; color:#000000; }.compile-error-data { font-family:arial,helvetica,sans-se=
rif; font-size:8pt; color:#FF0000; }.compile-warn-data { font-family:arial,=
helvetica,sans-serif; font-size:8pt; color:#CC9900; }.compile-sectionheader=
{ background-color:#000066; font-family:arial,helvetica,sans-serif; font-s=
ize:10pt; color:#FFFFFF; }.distributables-data { font-family:arial,helvetic=
a,sans-serif; font-size:8pt; color:#000000; }.distributables-sectionheader =
{ background-color:#000066; font-family:arial,helvetica,sans-serif; font-si=
ze:10pt; color:#FFFFFF; }.distributables-oddrow { background-color:#CCCCCC =
}.unittests-sectionheader { background-color:#000066; font-family:arial,hel=
vetica,sans-serif; font-size:10pt; color:#FFFFFF; }.unittests-oddrow { back=
ground-color:#CCCCCC }.unittests-data { font-family:arial,helvetica,sans-se=
rif; font-size:8pt; color:#000000; }.unittests-error { font-family:arial,he=
lvetica,sans-serif; font-size:8pt; color:#FF0000; }.checkstyle-oddrow { bac=
kground-color:#CCCCCC }.checkstyle-data { font-family:arial,helvetica,sans-=
serif; font-size:8pt; color:#000000; }.checkstyle-sectionheader { backgroun=
d-color:#000066; font-family:arial,helvetica,sans-serif; font-size:10pt; co=
lor:#FFFFFF; }
</style>
</head><body>
<p>
<table width=3D"98%" border=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=
=3D"center"><tr><td class=3D"header-title">BUILD COMPLETE - =
build.114</td></tr><tr><td class=3D"header-data"><span class=
=3D"header-label">Date of build: </span>10/05/2004 00:16:15</td></tr><=
tr><td class=3D"header-data"><span class=3D"header-label">Time to build:&nb=
sp;</span>13 minutes 25 seconds</td></tr><tr><td class=3D"header-data"><spa=
n class=3D"header-label">Last changed: </span>10/04/2004 19:05:46</td>=
</tr><tr><td class=3D"header-data"><span class=3D"header-label">Last log en=
try: </span>added PropertyPathFactoryBean</td></tr></table><p>
<table xmlns=3D"http://www.w3.org/TR/html4/strict.dtd" width=3D"98%" border=
=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=3D"center"/><p>
<p>
<table xmlns=3D"http://www.w3.org/TR/html4/strict.dtd" width=3D"98%" border=
=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=3D"center"><tr><td class=
=3D"compile-sectionheader"> Errors/Warnings: (=
6) </td></tr><tr><td><pre class=3D"compile-error-data">N=
ote: Some input files use or override a deprecated API.<br class=3D"none"/>=
Note: Recompile with -deprecation for details.Note: /jteam/build/checkout/s=
pring/spring/mock/org/springframework/mock/web/MockHttpSession.java uses or=
overrides a deprecated API.<br class=3D"none"/>Note: Recompile with -depre=
cation for details.<br class=3D"none"/>Note: Some input files use or overri=
de a deprecated API.<br class=3D"none"/>Note: Recompile with -deprecation f=
or details.<br class=3D"none"/></pre></td></tr></table><p>
<p>
<table width=3D"98%" border=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=
=3D"center"><tr><td colspan=3D"4" class=3D"unittests-sectionheader"> =
Unit Tests: (1470) </td></tr><tr><td><tabl=
e width=3D"98%" border=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=3D"c=
enter"><tr><td class=3D"unittests-data"> failure =
</td><td width=3D"40%" class=3D"unittests-data">testHomePage</td><td width=
=3D"40%" class=3D"unittests-data">org.springframework.apptests.buildtest.Al=
lTests</td></tr></table></td></tr><tr></tr><tr><td colspan=3D"2"> </td=
></tr><tr><td colspan=3D"4" class=3D"unittests-sectionheader"> =
Unit Test Error Details: (1) </td></tr><tr=
><td class=3D"unittests-data" colspan=3D"2"> Test: test=
HomePage</td></tr><tr><td class=3D"unittests-data" colspan=3D"2"> =
Class: org.springframework.apptests.buildtest.AllTests</td></tr>=
<tr><td class=3D"unittests-data" colspan=3D"2"> Type: junit.=
framework.AssertionFailedError</td></tr><tr><td class=3D"unittests-data" co=
lspan=3D"2"> Message: Exception while testing URL http://loc=
alhost:13084/buildtest:java.io.IOException</td></tr><tr><td class=3D"unitte=
sts-error" colspan=3D"2"><pre>junit.framework.AssertionFailedError: Excepti=
on while testing URL http://localhost:13084/buildtest:java.io.IOException<b=
r>=09at org.springframework.apptests.buildtest.AllTests.testHomePage(Unknow=
n Source)<br>=09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Meth=
od)<br>=09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess=
orImpl.java:39)<br>=09at sun.reflect.DelegatingMethodAccessorImpl.invoke(De=
legatingMethodAccessorImpl.java:25)<br></pre></td></tr><tr><td colspan=3D"2=
"> </td></tr></table><p>
<table width=3D"98%" border=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=
=3D"center"><tr><td colspan=3D"4" class=3D"modifications-sectionheader"> =
Modifications since last build: =
(55) </td></tr><tr class=3D"modifications-evenrow"><td =
class=3D"modifications-data">modified</td><td class=3D"modifications-data">=
jhoeller</td><td class=3D"modifications-data">/changelog.txt</td><td class=
=3D"modifications-data">added PropertyPathFactoryBean</td></tr><tr class=3D=
"modifications-oddrow"><td class=3D"modifications-data">modified</td><td cl=
ass=3D"modifications-data">jhoeller</td><td class=3D"modifications-data">sr=
c/org/springframework/beans/BeanWrapperImpl.java</td><td class=3D"modificat=
ions-data">polishing</td></tr><tr class=3D"modifications-evenrow"><td class=
=3D"modifications-data">modified</td><td class=3D"modifications-data">jhoel=
ler</td><td class=3D"modifications-data">src/org/springframework/beans/fact=
ory/BeanFactory.java</td><td class=3D"modifications-data">@since 1.1.2</td>=
</tr><tr class=3D"modifications-oddrow"><td class=3D"modifications-data">mo=
dified</td><td class=3D"modifications-data">jhoeller</td><td class=3D"modif=
ications-data">src/org/springframework/beans/factory/ListableBeanFactory.ja=
va</td><td class=3D"modifications-data">@since 1.1.2</td></tr><tr class=3D"=
modifications-evenrow"><td class=3D"modifications-data">modified</td><td cl=
ass=3D"modifications-data">jhoeller</td><td class=3D"modifications-data">sr=
c/org/springframework/beans/factory/support/AutowireUtils.java</td><td clas=
s=3D"modifications-data">@since 1.1.2</td></tr><tr class=3D"modifications-o=
ddrow"><td class=3D"modifications-data">added</td><td class=3D"modification=
s-data">jhoeller</td><td class=3D"modifications-data">test/org/springframew=
ork/beans/factory/config/PropertyPathFactoryBeanTests.java</td><td class=3D=
"modifications-data">added PropertyPathFactoryBean</td></tr><tr class=3D"mo=
difications-evenrow"><td class=3D"modifications-data">added</td><td class=
=3D"modifications-data">jhoeller</td><td class=3D"modifications-data">test/=
org/springframework/beans/factory/config/propertyPath.xml</td><td class=3D"=
modifications-data">added PropertyPathFactoryBean</td></tr><tr class=3D"mod=
ifications-oddrow"><td class=3D"modifications-data">added</td><td class=3D"=
modifications-data">jhoeller</td><td class=3D"modifications-data">src/org/s=
pringframework/beans/factory/config/PropertyPathFactoryBean.java</td><td cl=
ass=3D"modifications-data">added PropertyPathFactoryBean</td></tr><tr class=
=3D"modifications-evenrow"><td class=3D"modifications-data">modified</td><t=
d class=3D"modifications-data">davison</td><td class=3D"modifications-data"=
>/.classpath</td><td class=3D"modifications-data">add xsl:fo (fop) support =
to the sandbox</td></tr><tr class=3D"modifications-oddrow"><td class=3D"mod=
ifications-data">modified</td><td class=3D"modifications-data">jhoeller</td=
><td class=3D"modifications-data">/changelog.txt</td><td class=3D"modificat=
ions-data">BeanFactory.getType</td></tr><tr class=3D"modifications-evenrow"=
><td class=3D"modifications-data">modified</td><td class=3D"modifications-d=
ata">jhoeller</td><td class=3D"modifications-data">samples/jpetstore/src/or=
g/springframework/samples/jpetstore/service/client/OrderServiceClient.java<=
/td><td class=3D"modifications-data">use simple getBeansOfType version</td>=
</tr><tr class=3D"modifications-oddrow"><td class=3D"modifications-data">mo=
dified</td><td class=3D"modifications-data">jhoeller</td><td class=3D"modif=
ications-data">test/org/springframework/beans/factory/AbstractBeanFactoryTe=
sts.java</td><td class=3D"modifications-data">added "getType(name)" method =
to BeanFactory interface</td></tr><tr class=3D"modifications-evenrow"><td c=
lass=3D"modifications-data">modified</td><td class=3D"modifications-data">j=
hoeller</td><td class=3D"modifications-data">test/org/springframework/beans=
/factory/DefaultListableBeanFactoryTests.java</td><td class=3D"modification=
s-data">added "getType(name)" method to BeanFactory interface</td></tr><tr =
class=3D"modifications-oddrow"><td class=3D"modifications-data">modified</t=
d><td class=3D"modifications-data">jhoeller</td><td class=3D"modifications-=
data">test/org/springframework/beans/factory/access/BeanFactoryBootstrapTes=
ts.java</td><td class=3D"modifications-data">added "getType(name)" method t=
o BeanFactory interface</td></tr><tr class=3D"modifications-evenrow"><td cl=
ass=3D"modifications-data">modified</td><td class=3D"modifications-data">jh=
oeller</td><td class=3D"modifications-data">test/org/springframework/beans/=
factory/xml/dependencies-carg.xml</td><td class=3D"modifications-data">rena=
med XmlBeanFactoryTestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"mo=
difications-oddrow"><td class=3D"modifications-data">modified</td><td class=
=3D"modifications-data">jhoeller</td><td class=3D"modifications-data">test/=
org/springframework/beans/factory/xml/dependencies-dependsOn-inner.xml</td>=
<td class=3D"modifications-data">renamed XmlBeanFactoryTestSuite to XmlBean=
FactoryTests</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modi=
fications-data">modified</td><td class=3D"modifications-data">jhoeller</td>=
<td class=3D"modifications-data">test/org/springframework/beans/factory/xml=
/dependencies-dependsOn.xml</td><td class=3D"modifications-data">renamed Xm=
lBeanFactoryTestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"modifica=
tions-oddrow"><td class=3D"modifications-data">modified</td><td class=3D"mo=
difications-data">jhoeller</td><td class=3D"modifications-data">test/org/sp=
ringframework/beans/factory/xml/dependencies-prop-autowireByName.xml</td><t=
d class=3D"modifications-data">renamed XmlBeanFactoryTestSuite to XmlBeanFa=
ctoryTests</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifi=
cations-data">modified</td><td class=3D"modifications-data">jhoeller</td><t=
d class=3D"modifications-data">test/org/springframework/beans/factory/xml/d=
ependencies-prop-autowireByType.xml</td><td class=3D"modifications-data">re=
named XmlBeanFactoryTestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"=
modifications-oddrow"><td class=3D"modifications-data">modified</td><td cla=
ss=3D"modifications-data">jhoeller</td><td class=3D"modifications-data">tes=
t/org/springframework/beans/factory/xml/dependencies-prop-inner.xml</td><td=
class=3D"modifications-data">renamed XmlBeanFactoryTestSuite to XmlBeanFac=
toryTests</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modific=
ations-data">modified</td><td class=3D"modifications-data">jhoeller</td><td=
class=3D"modifications-data">test/org/springframework/beans/factory/xml/de=
pendencies-prop.xml</td><td class=3D"modifications-data">renamed XmlBeanFac=
toryTestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"modifications-od=
drow"><td class=3D"modifications-data">modified</td><td class=3D"modificati=
ons-data">jhoeller</td><td class=3D"modifications-data">test/org/springfram=
ework/beans/factory/xml/initializers.xml</td><td class=3D"modifications-dat=
a">renamed XmlBeanFactoryTestSuite to XmlBeanFactoryTests</td></tr><tr clas=
s=3D"modifications-evenrow"><td class=3D"modifications-data">modified</td><=
td class=3D"modifications-data">jhoeller</td><td class=3D"modifications-dat=
a">test/org/springframework/beans/factory/xml/reftypes.xml</td><td class=3D=
"modifications-data">renamed XmlBeanFactoryTestSuite to XmlBeanFactoryTests=
</td></tr><tr class=3D"modifications-oddrow"><td class=3D"modifications-dat=
a">deleted</td><td class=3D"modifications-data">jhoeller</td><td class=3D"m=
odifications-data">test/org/springframework/beans/factory/xml/XmlBeanFactor=
yTestSuite.java</td><td class=3D"modifications-data">renamed XmlBeanFactory=
TestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"modifications-evenro=
w"><td class=3D"modifications-data">added</td><td class=3D"modifications-da=
ta">jhoeller</td><td class=3D"modifications-data">test/org/springframework/=
beans/factory/xml/XmlBeanFactoryTests.java</td><td class=3D"modifications-d=
ata">renamed XmlBeanFactoryTestSuite to XmlBeanFactoryTests</td></tr><tr cl=
ass=3D"modifications-oddrow"><td class=3D"modifications-data">modified</td>=
<td class=3D"modifications-data">jhoeller</td><td class=3D"modifications-da=
ta">test/org/springframework/beans/factory/xml/default-lazy-init.xml</td><t=
d class=3D"modifications-data">renamed XmlBeanFactoryTestSuite to XmlBeanFa=
ctoryTests</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifi=
cations-data">modified</td><td class=3D"modifications-data">jhoeller</td><t=
d class=3D"modifications-data">test/org/springframework/beans/factory/xml/d=
elegationOverrides.xml</td><td class=3D"modifications-data">renamed XmlBean=
FactoryTestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"modifications=
-oddrow"><td class=3D"modifications-data">modified</td><td class=3D"modific=
ations-data">jhoeller</td><td class=3D"modifications-data">test/org/springf=
ramework/beans/factory/xml/dependencies-carg-autowire.xml</td><td class=3D"=
modifications-data">renamed XmlBeanFactoryTestSuite to XmlBeanFactoryTests<=
/td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifications-dat=
a">modified</td><td class=3D"modifications-data">jhoeller</td><td class=3D"=
modifications-data">test/org/springframework/beans/factory/xml/dependencies=
-carg-inner.xml</td><td class=3D"modifications-data">renamed XmlBeanFactory=
TestSuite to XmlBeanFactoryTests</td></tr><tr class=3D"modifications-oddrow=
"><td class=3D"modifications-data">modified</td><td class=3D"modifications-=
data">jhoeller</td><td class=3D"modifications-data">src/org/springframework=
/aop/framework/ProxyFactoryBean.java</td><td class=3D"modifications-data">u=
se BeanFactory.getType(name) rather than ConfigurableListableBeanFactory.ge=
tBeanDefinition(name).getBeanClass()</td></tr><tr class=3D"modifications-ev=
enrow"><td class=3D"modifications-data">modified</td><td class=3D"modificat=
ions-data">jhoeller</td><td class=3D"modifications-data">src/org/springfram=
ework/aop/target/AbstractPrototypeBasedTargetSource.java</td><td class=3D"m=
odifications-data">use BeanFactory.getType(name) rather than ConfigurableLi=
stableBeanFactory.getBeanDefinition(name).getBeanClass()</td></tr><tr class=
=3D"modifications-oddrow"><td class=3D"modifications-data">modified</td><td=
class=3D"modifications-data">jhoeller</td><td class=3D"modifications-data"=
>src/org/springframework/beans/factory/config/BeanDefinition.java</td><td c=
lass=3D"modifications-data">deprecated getBeanClass in favor of BeanFactory=
.getType</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifica=
tions-data">modified</td><td class=3D"modifications-data">jhoeller</td><td =
class=3D"modifications-data">src/org/springframework/beans/factory/xml/Defa=
ultXmlBeanDefinitionParser.java</td><td class=3D"modifications-data">factor=
ed out generateBeanName and registerBeanDefinition out into BeanDefinitionR=
eaderUtils</td></tr><tr class=3D"modifications-oddrow"><td class=3D"modific=
ations-data">modified</td><td class=3D"modifications-data">jhoeller</td><td=
class=3D"modifications-data">src/org/springframework/beans/factory/support=
/BeanDefinitionReaderUtils.java</td><td class=3D"modifications-data">factor=
ed out generateBeanName and registerBeanDefinition out into BeanDefinitionR=
eaderUtils</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifi=
cations-data">modified</td><td class=3D"modifications-data">jhoeller</td><t=
d class=3D"modifications-data">src/org/springframework/beans/factory/BeanFa=
ctoryUtils.java</td><td class=3D"modifications-data">moved isFactoryDerefer=
ence and transformedBeanName over from AbstractBeanFactory, completed bean(=
s)OfTypeIncludingAncestors convenience methods</td></tr><tr class=3D"modifi=
cations-oddrow"><td class=3D"modifications-data">modified</td><td class=3D"=
modifications-data">jhoeller</td><td class=3D"modifications-data">src/org/s=
pringframework/context/support/AbstractApplicationContext.java</td><td clas=
s=3D"modifications-data">added "getType(name)" method to BeanFactory interf=
ace, added "getBeansOfType(type)" convenience method to ListableBeanFactory=
interface</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifi=
cations-data">modified</td><td class=3D"modifications-data">jhoeller</td><t=
d class=3D"modifications-data">src/org/springframework/beans/factory/BeanIs=
NotAFactoryException.java</td><td class=3D"modifications-data">hold actualC=
lass rather than actualInstance</td></tr><tr class=3D"modifications-oddrow"=
><td class=3D"modifications-data">modified</td><td class=3D"modifications-d=
ata">jhoeller</td><td class=3D"modifications-data">src/org/springframework/=
beans/factory/BeanNotOfRequiredTypeException.java</td><td class=3D"modifica=
tions-data">hold actualClass rather than actualInstance</td></tr><tr class=
=3D"modifications-evenrow"><td class=3D"modifications-data">modified</td><t=
d class=3D"modifications-data">jhoeller</td><td class=3D"modifications-data=
">src/org/springframework/beans/factory/support/DefaultListableBeanFactory.=
java</td><td class=3D"modifications-data">added "getBeansOfType(type)" conv=
enience method to ListableBeanFactory interface</td></tr><tr class=3D"modif=
ications-oddrow"><td class=3D"modifications-data">modified</td><td class=3D=
"modifications-data">jhoeller</td><td class=3D"modifications-data">src/org/=
springframework/beans/factory/support/StaticListableBeanFactory.java</td><t=
d class=3D"modifications-data">added "getBeansOfType(type)" convenience met=
hod to ListableBeanFactory interface</td></tr><tr class=3D"modifications-ev=
enrow"><td class=3D"modifications-data">modified</td><td class=3D"modificat=
ions-data">jhoeller</td><td class=3D"modifications-data">src/org/springfram=
ework/beans/factory/ListableBeanFactory.java</td><td class=3D"modifications=
-data">added "getBeansOfType(type)" convenience method to ListableBeanFacto=
ry interface</td></tr><tr class=3D"modifications-oddrow"><td class=3D"modif=
ications-data">modified</td><td class=3D"modifications-data">jhoeller</td><=
td class=3D"modifications-data">src/org/springframework/beans/factory/BeanF=
actory.java</td><td class=3D"modifications-data">added "getType(name)" meth=
od to BeanFactory interface, moved "FACTORY_BEAN_PREFIX" constant to BeanFa=
ctory interface, refactored AbstractBeanFactory's "getBean" implementation =
to do more aggressive upfront type checking</td></tr><tr class=3D"modificat=
ions-evenrow"><td class=3D"modifications-data">modified</td><td class=3D"mo=
difications-data">jhoeller</td><td class=3D"modifications-data">src/org/spr=
ingframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java<=
/td><td class=3D"modifications-data">added "getType(name)" method to BeanFa=
ctory interface, moved "FACTORY_BEAN_PREFIX" constant to BeanFactory interf=
ace, refactored AbstractBeanFactory's "getBean" implementation to do more a=
ggressive upfront type checking</td></tr><tr class=3D"modifications-oddrow"=
><td class=3D"modifications-data">modified</td><td class=3D"modifications-d=
ata">jhoeller</td><td class=3D"modifications-data">src/org/springframework/=
beans/factory/support/AbstractBeanFactory.java</td><td class=3D"modificatio=
ns-data">added "getType(name)" method to BeanFactory interface, moved "FACT=
ORY_BEAN_PREFIX" constant to BeanFactory interface, refactored AbstractBean=
Factory's "getBean" implementation to do more aggressive upfront type check=
ing</td></tr><tr class=3D"modifications-evenrow"><td class=3D"modifications=
-data">modified</td><td class=3D"modifications-data">jhoeller</td><td class=
=3D"modifications-data">/changelog.txt</td><td class=3D"modifications-data"=
>refactored AbstractAutowireCapableBeanFactory</td></tr><tr class=3D"modifi=
cations-oddrow"><td class=3D"modifications-data">deleted</td><td class=3D"m=
odifications-data">jhoeller</td><td class=3D"modifications-data">test/org/s=
pringframework/beans/factory/DefaultListableBeanFactoryTestSuite.java</td><=
td class=3D"modifications-data">renamed DefaultListableBeanFactoryTestSuite=
to DefaultListableBeanFactoryTests</td></tr><tr class=3D"modifications-eve=
nrow"><td class=3D"modifications-data">added</td><td class=3D"modifications=
-data">jhoeller</td><td class=3D"modifications-data">test/org/springframewo=
rk/beans/factory/DefaultListableBeanFactoryTests.java</td><td class=3D"modi=
fications-data">renamed DefaultListableBeanFactoryTestSuite to DefaultLista=
bleBeanFactoryTests</td></tr><tr class=3D"modifications-oddrow"><td class=
=3D"modifications-data">modified</td><td class=3D"modifications-data">jhoel=
ler</td><td class=3D"modifications-data">src/org/springframework/beans/fact=
ory/support/BeanDefinitionReaderUtils.java</td><td class=3D"modifications-d=
ata">polishing, improved javadoc</td></tr><tr class=3D"modifications-evenro=
w"><td class=3D"modifications-data">modified</td><td class=3D"modifications=
-data">jhoeller</td><td class=3D"modifications-data">src/org/springframewor=
k/beans/factory/support/DefaultListableBeanFactory.java</td><td class=3D"mo=
difications-data">polishing, improved javadoc</td></tr><tr class=3D"modific=
ations-oddrow"><td class=3D"modifications-data">modified</td><td class=3D"m=
odifications-data">jhoeller</td><td class=3D"modifications-data">src/org/sp=
ringframework/beans/factory/support/InstantiationStrategy.java</td><td clas=
s=3D"modifications-data">polishing, improved javadoc</td></tr><tr class=3D"=
modifications-evenrow"><td class=3D"modifications-data">modified</td><td cl=
ass=3D"modifications-data">jhoeller</td><td class=3D"modifications-data">sr=
c/org/springframework/beans/factory/support/StaticListableBeanFactory.java<=
/td><td class=3D"modifications-data">polishing, improved javadoc</td></tr><=
tr class=3D"modifications-oddrow"><td class=3D"modifications-data">modified=
</td><td class=3D"modifications-data">jhoeller</td><td class=3D"modificatio=
ns-data">src/org/springframework/beans/factory/support/AbstractAutowireCapa=
bleBeanFactory.java</td><td class=3D"modifications-data">moved "destroyBean=
" implementation from AbstractAutowireCapableBeanFactory up to AbstractBean=
Factory, refined internal structure and visibilities of AbstractBeanFactory=
and AbstractAutowireCapableBeanFactory</td></tr><tr class=3D"modifications=
-evenrow"><td class=3D"modifications-data">modified</td><td class=3D"modifi=
cations-data">jhoeller</td><td class=3D"modifications-data">src/org/springf=
ramework/beans/factory/support/AbstractBeanFactory.java</td><td class=3D"mo=
difications-data">moved "destroyBean" implementation from AbstractAutowireC=
apableBeanFactory up to AbstractBeanFactory, refined internal structure and=
visibilities of AbstractBeanFactory and AbstractAutowireCapableBeanFactory=
</td></tr><tr class=3D"modifications-oddrow"><td class=3D"modifications-dat=
a">added</td><td class=3D"modifications-data">jhoeller</td><td class=3D"mod=
ifications-data">src/org/springframework/beans/factory/support/AutowireUtil=
s.java</td><td class=3D"modifications-data">moved "destroyBean" implementat=
ion from AbstractAutowireCapableBeanFactory up to AbstractBeanFactory, refi=
ned internal structure and visibilities of AbstractBeanFactory and Abstract=
AutowireCapableBeanFactory</td></tr><tr class=3D"modifications-evenrow"><td=
class=3D"modifications-data">modified</td><td class=3D"modifications-data"=
>jhoeller</td><td class=3D"modifications-data">src/org/springframework/web/=
servlet/DispatcherServlet.java</td><td class=3D"modifications-data">fixed H=
andlerExceptionResolver fallback in case of "detectAllHandlerExceptionResol=
vers"=3Dfalse</td></tr></table><p>
<table width=3D"98%" border=3D"0" cellspacing=3D"0" cellpadding=3D"2" align=
=3D"center"><tr><td class=3D"distributables-sectionheader"> =
Deployments by this build: (8) </td><=
/tr><tr><td class=3D"distributables-data">Building jar: /jteam/build/checko=
ut/spring/spring/dist/spring.jar</td></tr><tr class=3D"distributables-oddro=
w"><td class=3D"distributables-data">Building war: /jteam/build/checkout/sp=
ring/spring/autobuilds/apps/buildtest/dist/buildtest.war</td></tr><tr><td c=
lass=3D"distributables-data">Building war: /jteam/build/checkout/spring/spr=
ing/autobuilds/apps/buildtest/dist/buildtest.war</td></tr><tr class=3D"dist=
ributables-oddrow"><td class=3D"distributables-data">Building war: /jteam/b=
uild/checkout/spring/spring/autobuilds/apps/buildtest/dist/buildtest.war</t=
d></tr><tr><td class=3D"distributables-data">Building jar: /jteam/build/che=
ckout/spring/spring/autobuilds/apps/jpetstore/war/WEB-INF/lib/jpetstore.jar=
</td></tr><tr class=3D"distributables-oddrow"><td class=3D"distributables-d=
ata">Building war: /jteam/build/checkout/spring/spring/autobuilds/apps/jpet=
store/dist/jpetstore.war</td></tr><tr><td class=3D"distributables-data">Bui=
lding jar: /jteam/build/checkout/spring/spring/autobuilds/apps/jpetstore/wa=
r/WEB-INF/lib/jpetstore.jar</td></tr><tr class=3D"distributables-oddrow"><t=
d class=3D"distributables-data">Building war: /jteam/build/checkout/spring/=
spring/autobuilds/apps/jpetstore/dist/jpetstore.war</td></tr></table>
</body></html> |
|
From: Ben A. <ben...@ac...> - 2004-10-04 22:13:53
|
Ben Alex wrote:
> My controller then does this:
>
> protected void onBindAndValidate(HttpServletRequest request,
> Object command, BindException errors) throws Exception {
> Person person = (Person) command;
> if (errors.hasFieldErrors("luhn")) {
> // Cast is safe as createBinder caused MyBindException to
> be used
> MyBindException myErrors = (MyBindException) errors;
> errors.rejectValue("luhn", "LUHN_INVALID", "A valid Luhn is
> required.");
> } ....
>
>
Ooops, that code fragment forgot a line:
// Cast is safe as createBinder caused MyBindException to be use
MyBindException myErrors = (MyBindException) errors;
myErrors.removeErrors(myErrors.getFieldErrors("luhn"));
// *********
errors.rejectValue("luhn", "LUHN_INVALID", "2 A valid Luhn is
required.");
|
|
From: Ben A. <ben...@ac...> - 2004-10-04 22:10:53
|
I'm using SimpleFormController to process a form containing a parameter that is converted to a Long value in the form backing object. The Long has a check digit and thus there are both number format exceptions as well as check digit related exceptions possible. By default such errors will cause the following messages to be displayed to the user in the errors list: Failed to convert property value of type [java.lang.String] to required type [java.lang.Long] for property 'luhn'; nested exception is java.lang.IllegalArgumentException: Cannot parse number: Unparseable number: "aString" or Property 'luhn' threw exception; nested exception is java.lang.IllegalArgumentException: Business key must be a valid Luhn identifier Neither response is suitable for display to users. I would rather replace these with my own more user-friendly message. One approach discussed at http://forum.springframework.org/viewtopic.php?t=1098 (last post by ojolly) is for the PropertyEditor to set the object to null, then detect something was actually entered in the request parameter in onBindAndValidate and then add a friendly error. That's OK, but then you lose whatever the user actually typed in as the PropertyEditor set it to null. This is unacceptable as quite often the data entered will be close to what it should have been (eg an unwanted fractional portion for an integer, a mis-typed digit for a checksum-based number, a property that is simply too long etc). I ended up writing a MyBindException which subclasses BindException and provides these two methods: public void removeError(ObjectError error) { this.errors.remove(error); } public void removeErrors(List objectErrors) { Iterator iter = objectErrors.iterator(); while (iter.hasNext()) { ObjectError objectError = (ObjectError) iter.next(); removeError(objectError); } } My controller then does this: protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors) throws Exception { Person person = (Person) command; if (errors.hasFieldErrors("luhn")) { // Cast is safe as createBinder caused MyBindException to be used MyBindException myErrors = (MyBindException) errors; errors.rejectValue("luhn", "LUHN_INVALID", "A valid Luhn is required."); } .... This works great. It consumes the unwanted, uninformative user feedback and replaces it. It also avoids needing to look at HttpServetRequest parameters. The problem is to achieve this I've needed to write MyBindException, copy nine methods to it (as the errors List is private in the BindException superclass), write a MyServletRequestDataBinder to set it up, and then override createBinder in the controller to use MyServletRequestDataBinder. It seems a lot of work, so I was hoping we could add the above two methods to BindException? Alternatively, at least making the errors List protected in BindException will save the ugly code duplication. Alternatively, if there's another way entirely of achieving this, I'd be grateful if someone would let me know. Best regards Ben |
|
From: Dmitriy K. <dko...@ru...> - 2004-10-04 21:53:02
|
Rod, if it's not a secret, what strategy did you use to configure a constant value via a property? Did you utilize org.springframework.core.Constants class in conjunction with MethodInvokingFactoryBean? +1 for support to easily evaluate a constant in application context. Regards, Dmitriy. Rod Johnson wrote: >Have to say that this looks to me like it's making a case for an expression >language instead of a FactoryBean. > >A similar requirement that would also be well addressed by OGNL/whatever: >evaluating a constant. E.g. an AutowireCapableBeanFactory constant, which I >recently had to configure via a property. It would be nice to be able to do >that easily. > >Rgds >Rod > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...] On Behalf Of >Colin Sampaleanu >Sent: 04 October 2004 18:32 >To: spr...@li... >Subject: Re: [Springframework-developer] PropertyPathFactoryBean > >Good stuff. It overlaps of course with the mythical OGNL or expression >support which keeps getting pushed back, but in the meantime provides some >of the benefits for pretty little extra code... > > >jürgen höller [werk3AT] wrote: > > > >>I've just added a PropertyPathFactoryBean, following this suggestion: >> >>http://opensource.atlassian.com/projects/spring/browse/SPR-343 >> >> >>Usage examples: >> >>// target bean to be referenced by name <bean id="tb" >>class="org.springframework.beans.TestBean" singleton="false"> >> <property name="age"><value>10</value></property> >> <property name="spouse"> >> <bean class="org.springframework.beans.TestBean"> >> <property name="age"><value>11</value></property> >> </bean> >> </property> >></bean> >> >>// will result in 12, which is the value of property 'age' of the >>inner bean <bean id="propertyPath1" >> >> >class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> > > >> <property name="targetObject"> >> <bean class="org.springframework.beans.TestBean"> >> <property name="age"><value>12</value></property> >> </bean> >> </property> >> <property name="propertyPath"><value>age</value></property> >></bean> >> >>// will result in 11, which is the value of property 'spouse.age' of bean >> >> >'tb' > > >><bean id="propertyPath2" >> >> >class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> > > >> <property name="targetBeanName"><value>tb</value></property> >> <property name="propertyPath"><value>spouse.age</value></property> >></bean> >> >>// will result in 10, which is the value of property 'age' of bean 'tb' >><bean id="tb.age" >>class="org.springframework.beans.factory.config.PropertyPathFactoryBea >>n"/> >> >> >>The last one, interpreting the bean name as 'beanName.property' pattern, is >> >> >quite concise... > > >> >> >> >> > > > > >------------------------------------------------------- >This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use >IT products in your business? Tell us what you think of them. Give us Your >Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >http://productguide.itmanagersjournal.com/guidepromo.tmpl >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > >------------------------------------------------------- >This SF.net email is sponsored by: IT Product Guide on ITManagersJournal >Use IT products in your business? Tell us what you think of them. Give us >Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more >http://productguide.itmanagersjournal.com/guidepromo.tmpl >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Rod J. <ro...@in...> - 2004-10-04 20:52:03
|
Have to say that this looks to me like it's making a case for an = expression language instead of a FactoryBean.=20 A similar requirement that would also be well addressed by = OGNL/whatever: evaluating a constant. E.g. an AutowireCapableBeanFactory constant, = which I recently had to configure via a property. It would be nice to be able to = do that easily. Rgds Rod -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Colin Sampaleanu Sent: 04 October 2004 18:32 To: spr...@li... Subject: Re: [Springframework-developer] PropertyPathFactoryBean Good stuff. It overlaps of course with the mythical OGNL or expression support which keeps getting pushed back, but in the meantime provides = some of the benefits for pretty little extra code... j=FCrgen h=F6ller [werk3AT] wrote: >I've just added a PropertyPathFactoryBean, following this suggestion: > >http://opensource.atlassian.com/projects/spring/browse/SPR-343 > > >Usage examples: > > // target bean to be referenced by name <bean id=3D"tb"=20 > class=3D"org.springframework.beans.TestBean" singleton=3D"false"> > <property name=3D"age"><value>10</value></property> > <property name=3D"spouse"> > <bean class=3D"org.springframework.beans.TestBean"> > <property name=3D"age"><value>11</value></property> > </bean> > </property> > </bean> > > // will result in 12, which is the value of property 'age' of the=20 > inner bean <bean id=3D"propertyPath1" class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "> > <property name=3D"targetObject"> > <bean class=3D"org.springframework.beans.TestBean"> > <property name=3D"age"><value>12</value></property> > </bean> > </property> > <property name=3D"propertyPath"><value>age</value></property> > </bean> > > // will result in 11, which is the value of property 'spouse.age' of = bean 'tb' > <bean id=3D"propertyPath2" class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "> > <property name=3D"targetBeanName"><value>tb</value></property> > <property name=3D"propertyPath"><value>spouse.age</value></property> > </bean> > > // will result in 10, which is the value of property 'age' of bean = 'tb' > <bean id=3D"tb.age"=20 > = class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBea > n"/> > > >The last one, interpreting the bean name as 'beanName.property' = pattern, is quite concise... > =20 > ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal = Use IT products in your business? Tell us what you think of them. Give us = Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2004-10-04 17:33:47
|
Good stuff. It overlaps of course with the mythical OGNL or expression support which keeps getting pushed back, but in the meantime provides some of the benefits for pretty little extra code... jürgen höller [werk3AT] wrote: >I've just added a PropertyPathFactoryBean, following this suggestion: > >http://opensource.atlassian.com/projects/spring/browse/SPR-343 > > >Usage examples: > > // target bean to be referenced by name > <bean id="tb" class="org.springframework.beans.TestBean" singleton="false"> > <property name="age"><value>10</value></property> > <property name="spouse"> > <bean class="org.springframework.beans.TestBean"> > <property name="age"><value>11</value></property> > </bean> > </property> > </bean> > > // will result in 12, which is the value of property 'age' of the inner bean > <bean id="propertyPath1" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> > <property name="targetObject"> > <bean class="org.springframework.beans.TestBean"> > <property name="age"><value>12</value></property> > </bean> > </property> > <property name="propertyPath"><value>age</value></property> > </bean> > > // will result in 11, which is the value of property 'spouse.age' of bean 'tb' > <bean id="propertyPath2" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"> > <property name="targetBeanName"><value>tb</value></property> > <property name="propertyPath"><value>spouse.age</value></property> > </bean> > > // will result in 10, which is the value of property 'age' of bean 'tb' > <bean id="tb.age" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/> > > >The last one, interpreting the bean name as 'beanName.property' pattern, is quite concise... > > |
|
From: Rod J. <ro...@in...> - 2004-10-04 16:54:04
|
I think the time has come for an extensions package. Also possibly a = contrib area. For example, scripting support for Jython and Rhino. We will ship Groovy = and Beanshell support in the core in 1.2, but users who want other languages could download the extensions... If we don't do this, the download size will snowball, and some people = will get put off Spring as a whole. (Wrongly, but that's not the point.) R -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf = Of Dmitriy Kopylenko Sent: 04 October 2004 14:13 To: spr...@li... Subject: Re: [Springframework-developer] XSL-FO (Apache-FOP) +1 for extension distribution. Regards, Dmitriy. j=FCrgen h=F6ller [werk3AT] wrote: > Darren, > =20 > While this is certainly a worthwhile extension, I'm not sure if we=20 > should raise the size of the Spring core distribution with a further > 1.3 MB jar file for such special functionality, in particular for a=20 > library that is still in 0.x (i.e. whose API is not guaranteed to stay = > stable). I'm a bit worried in that respect... Do you know what=20 > timeframe the next FOP major release is scheduled for? > =20 > Thus, I suggest to put the FOP support classes into the sandbox for=20 > the time being... like we do for Commons Validator and co. People will = > use it from there too, like they already do with the Commons Validator = > support and the Portlet stuff... We can always move it over once we=20 > agree that the time is right. Another option would be to start=20 > shipping a separate extension distribution... > =20 > Opinions? (both on FOP support and the extension distribution idea...) > =20 > Juergen > =20 > > ---------------------------------------------------------------------- > -- > *Von:* spr...@li... im=20 > Auftrag von Darren Davison > *Gesendet:* Mo 04.10.2004 11:16 > *An:* spr...@li... > *Betreff:* [Springframework-developer] XSL-FO (Apache-FOP) > > > There have been a couple of posts in the forums about FOP=20 > = (http://forum.springframework.org/search.php?search&search_keywords=3Dfo > p > = <http://forum.springframework.org/search.php?search&search_keywords=3Dfo > p>) > and > we now have a similar requirement here in one of our projects. > > It's actually pretty trivial to implement when extending=20 > AbstractXsltView but I think it's useful to include the generic parts=20 > in the framework. > Additional > build dependencies include only fop.jar (~1.3MB) although the target=20 > app will have to include batik.jar and the avalon framework jar as=20 > runtime dependencies since FOP is hardlinked to Avalon logging in the=20 > current stable branch. This will change to commons logging in the=20 > next major release. > > I'd like to commit this if there are no objections. No modifications=20 > are required to existing framework classes and it could go in for=20 > 1.1.2 I think. > > (Any comments welcome from those with significant FOP experience as I=20 > don't have a great deal). > > > -- > Darren Davison > Public Key: #DD356B0D > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on = ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give = us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out = > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give = us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out = more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <jue...@we...> - 2004-10-04 16:15:25
|
I've just added a PropertyPathFactoryBean, following this suggestion: http://opensource.atlassian.com/projects/spring/browse/SPR-343 Usage examples: // target bean to be referenced by name <bean id=3D"tb" class=3D"org.springframework.beans.TestBean" = singleton=3D"false"> <property name=3D"age"><value>10</value></property> <property name=3D"spouse"> <bean class=3D"org.springframework.beans.TestBean"> <property name=3D"age"><value>11</value></property> </bean> </property> </bean> // will result in 12, which is the value of property 'age' of the inner = bean <bean id=3D"propertyPath1" = class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "> <property name=3D"targetObject"> <bean class=3D"org.springframework.beans.TestBean"> <property name=3D"age"><value>12</value></property> </bean> </property> <property name=3D"propertyPath"><value>age</value></property> </bean> // will result in 11, which is the value of property 'spouse.age' of = bean 'tb' <bean id=3D"propertyPath2" = class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "> <property name=3D"targetBeanName"><value>tb</value></property> <property name=3D"propertyPath"><value>spouse.age</value></property> </bean> // will result in 10, which is the value of property 'age' of bean 'tb' <bean id=3D"tb.age" = class=3D"org.springframework.beans.factory.config.PropertyPathFactoryBean= "/> The last one, interpreting the bean name as 'beanName.property' pattern, = is quite concise... Juergen |
|
From: Darren D. <da...@da...> - 2004-10-04 15:03:21
|
On Mon, October 4, 2004 15:10, Colin Sampaleanu said: > From what you're saying it sounds like it doesn't make sense to put it > into the sandbox on the basis that FOP is immature. Hi Colin, you replied to my post but I'm unsure if this is directed at me or Juerge= n..? If me, then in my opinion FOP itself is not that immature - their choice = of version number is simply inappropriate. FOP has been in fairly widesprea= d use for well over 3 years now. If not me, ignore the above :) Regards, --=20 Darren Davison Public Key: #DD356B0D |
|
From: Darren D. <da...@da...> - 2004-10-04 14:19:00
|
On Mon, October 4, 2004 14:25, j=FCrgen h=F6ller [werk3AT] said: > It's just about *further* dependencies for things that are not fully > tested/reviewed yet or that we are not completely happy with. There pro= bably > will never be a clear line here: We'd have to decide on a case-by-cases= basis > what should go into the core or into the extension package. ok. > FOP support should definitely go into the sandbox I'll commit it there promptly. Thanks! --=20 Darren Davison Public Key: #DD356B0D |
|
From: Colin S. <col...@ex...> - 2004-10-04 14:11:46
|
Darren Davison wrote: >On Mon, October 4, 2004 13:13, jürgen höller [werk3AT] said: > > >>Darren, >> >>While this is certainly a worthwhile extension, I'm not sure if we should >>raise the size of the Spring core distribution with a further 1.3 MB jar file >>for such special functionality, in particular for a library that is still in >>0.x (i.e. whose API is not guaranteed to stay stable). I'm a bit worried in >>that respect... Do you know what timeframe the next FOP major release is >>scheduled for? >> >> > >It's a big jar for such a small class, agreed. But then again, 1.3Mb isn't >much on top of what is already a 26MB+ download. > >The 0.x version is annoying, but also slightly misleading. A lot of projects >these days hugely overuse the 0.x versioning - particularly in the GNU space >where some software has been in production use for years (literally) and yet >still has a 0.x version number. 0.20.5 is a stable, supported branch of FOP. >The API *will* change in the rewrite (currently only available via CVS), see >http://xml.apache.org/fop/dev/index.html#lines for more info. But then that's >not really any different to other projects that we currently ship a dependency >for as they could change their API in the next major release. Changes to the >FOP API should be hidden within the View implementation in Spring and won't >affect end users. > >I'm not overly concerned if it goes in the sandbox or not at all since it's >trivial to code it as an extension in my apps. It just seemed like a useful >addition that we needed anyway and others had already asked for. > >Just my $0.02 - be interested to hear anyone else's. > > > >>Thus, I suggest to put the FOP support classes into the sandbox for the time >>being... like we do for Commons Validator and co. People will use it from >>there too, like they already do with the Commons Validator support and the >>Portlet stuff... We can always move it over once we agree that the time is >>right. Another option would be to start shipping a separate extension >>distribution... >> >>Opinions? (both on FOP support and the extension distribution idea...) >> >> > >would some of the currently core things then move into the 'extension' distro >(Velocity/FreeMarker/POI et al)? I'm unsure how this works.. > > > From what you're saying it sounds like it doesn't make sense to put it into the sandbox on the basis that FOP is immature. The question to me becomes how much we let Spring grow, and what are 'core' features that must ship with it, and what are 'extensions', and what are related projects? I was chatting a bit with Keith on the weekend about the validator stuff that's currently in the sandbox, but has become pretty mature, and is used by the Spring Rich Client Project, and could probably be of use to other Spring users. There's a question of where that would go. It's probably big enough that it should maybe be its own project, which is manageable I guess. But once you start splitting off all these little bits and pieces you open up the potential at least for a lot of dependency issues. Extensions I guess is a bit different than related project, since at least it would probably be built one-to-one with the main project... Colin |
|
From: <jue...@we...> - 2004-10-04 13:24:04
|
Darren, > would some of the currently core things then move into the 'extension' > distro (Velocity/FreeMarker/POI et al)? I'm unsure how this works.. Actually, I'd like to keep everything that we currently ship in the = core, to provide a single comprehensive distribution package. It's just about *further* dependencies for things that are not fully = tested/reviewed yet or that we are not completely happy with. There = probably will never be a clear line here: We'd have to decide on a = case-by-cases basis what should go into the core or into the extension = package. FOP support should definitely go into the sandbox! People will use this = and give further feedback on it. (We're lucky that we have quite a lot = of "sandbox-aware" users!) I'd just like to defer adding it to the core = for a while, until things have clarified a bit further. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Darren Davison Sent: Monday, October 04, 2004 3:02 PM To: spr...@li... Subject: Re: [Springframework-developer] XSL-FO (Apache-FOP) On Mon, October 4, 2004 13:13, j=FCrgen h=F6ller [werk3AT] said: > Darren, > > While this is certainly a worthwhile extension, I'm not sure if we = should > raise the size of the Spring core distribution with a further 1.3 MB = jar file > for such special functionality, in particular for a library that is = still in > 0.x (i.e. whose API is not guaranteed to stay stable). I'm a bit = worried in > that respect... Do you know what timeframe the next FOP major release = is > scheduled for? It's a big jar for such a small class, agreed. But then again, 1.3Mb = isn't much on top of what is already a 26MB+ download. The 0.x version is annoying, but also slightly misleading. A lot of = projects these days hugely overuse the 0.x versioning - particularly in the GNU = space where some software has been in production use for years (literally) and = yet still has a 0.x version number. 0.20.5 is a stable, supported branch of = FOP.=20 The API *will* change in the rewrite (currently only available via CVS), = see http://xml.apache.org/fop/dev/index.html#lines for more info. But then = that's not really any different to other projects that we currently ship a = dependency for as they could change their API in the next major release. Changes = to the FOP API should be hidden within the View implementation in Spring and = won't affect end users. I'm not overly concerned if it goes in the sandbox or not at all since = it's trivial to code it as an extension in my apps. It just seemed like a = useful addition that we needed anyway and others had already asked for. Just my $0.02 - be interested to hear anyone else's. > Thus, I suggest to put the FOP support classes into the sandbox for = the time > being... like we do for Commons Validator and co. People will use it = from > there too, like they already do with the Commons Validator support and = the > Portlet stuff... We can always move it over once we agree that the = time is > right. Another option would be to start shipping a separate extension > distribution... > > Opinions? (both on FOP support and the extension distribution idea...) would some of the currently core things then move into the 'extension' = distro (Velocity/FreeMarker/POI et al)? I'm unsure how this works.. --=20 Darren Davison Public Key: #DD356B0D ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give = us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out = more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Dmitriy K. <dko...@ru...> - 2004-10-04 13:11:37
|
+1 for extension distribution. Regards, Dmitriy. jürgen höller [werk3AT] wrote: > Darren, > > While this is certainly a worthwhile extension, I'm not sure if we > should raise the size of the Spring core distribution with a further > 1.3 MB jar file for such special functionality, in particular for a > library that is still in 0.x (i.e. whose API is not guaranteed to stay > stable). I'm a bit worried in that respect... Do you know > what timeframe the next FOP major release is scheduled for? > > Thus, I suggest to put the FOP support classes into the sandbox for > the time being... like we do for Commons Validator and co. People will > use it from there too, like they already do with the Commons Validator > support and the Portlet stuff... We can always move it over once we > agree that the time is right. Another option would be to start > shipping a separate extension distribution... > > Opinions? (both on FOP support and the extension distribution idea...) > > Juergen > > > ------------------------------------------------------------------------ > *Von:* spr...@li... im > Auftrag von Darren Davison > *Gesendet:* Mo 04.10.2004 11:16 > *An:* spr...@li... > *Betreff:* [Springframework-developer] XSL-FO (Apache-FOP) > > > There have been a couple of posts in the forums about FOP > (http://forum.springframework.org/search.php?search&search_keywords=fop > <http://forum.springframework.org/search.php?search&search_keywords=fop>) > and > we now have a similar requirement here in one of our projects. > > It's actually pretty trivial to implement when extending > AbstractXsltView but > I think it's useful to include the generic parts in the framework. > Additional > build dependencies include only fop.jar (~1.3MB) although the target > app will > have to include batik.jar and the avalon framework jar as runtime > dependencies > since FOP is hardlinked to Avalon logging in the current stable > branch. This > will change to commons logging in the next major release. > > I'd like to commit this if there are no objections. No modifications are > required to existing framework classes and it could go in for 1.1.2 I > think. > > (Any comments welcome from those with significant FOP experience as I > don't > have a great deal). > > > -- > Darren Davison > Public Key: #DD356B0D > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Darren D. <da...@da...> - 2004-10-04 13:02:30
|
On Mon, October 4, 2004 13:13, j=FCrgen h=F6ller [werk3AT] said: > Darren, > > While this is certainly a worthwhile extension, I'm not sure if we shou= ld > raise the size of the Spring core distribution with a further 1.3 MB ja= r file > for such special functionality, in particular for a library that is sti= ll in > 0.x (i.e. whose API is not guaranteed to stay stable). I'm a bit worrie= d in > that respect... Do you know what timeframe the next FOP major release i= s > scheduled for? It's a big jar for such a small class, agreed. But then again, 1.3Mb isn= 't much on top of what is already a 26MB+ download. The 0.x version is annoying, but also slightly misleading. A lot of proj= ects these days hugely overuse the 0.x versioning - particularly in the GNU sp= ace where some software has been in production use for years (literally) and = yet still has a 0.x version number. 0.20.5 is a stable, supported branch of = FOP.=20 The API *will* change in the rewrite (currently only available via CVS), = see http://xml.apache.org/fop/dev/index.html#lines for more info. But then t= hat's not really any different to other projects that we currently ship a depen= dency for as they could change their API in the next major release. Changes to= the FOP API should be hidden within the View implementation in Spring and won= 't affect end users. I'm not overly concerned if it goes in the sandbox or not at all since it= 's trivial to code it as an extension in my apps. It just seemed like a use= ful addition that we needed anyway and others had already asked for. Just my $0.02 - be interested to hear anyone else's. > Thus, I suggest to put the FOP support classes into the sandbox for the= time > being... like we do for Commons Validator and co. People will use it fr= om > there too, like they already do with the Commons Validator support and = the > Portlet stuff... We can always move it over once we agree that the time= is > right. Another option would be to start shipping a separate extension > distribution... > > Opinions? (both on FOP support and the extension distribution idea...) would some of the currently core things then move into the 'extension' di= stro (Velocity/FreeMarker/POI et al)? I'm unsure how this works.. --=20 Darren Davison Public Key: #DD356B0D |
|
From: <jue...@we...> - 2004-10-04 12:54:28
|
Hi everybody, In the past few days, I've refactored our bean factory implementations, = mainly to reduce the size of AbstractAutowireCapableBeanFactory. I've moved the current bean destruction logic up to AbstractBeanFactory, = which is possible since 1.1 where dependent beans are determined = differently. AbstractAutowireCapableBeanFactory is now just responsible = for actual bean creation, with and without autowiring etc. I've also = moved some supporting logic to a new AutowireUtils helper class. In the course of this, I've noticed that the type check for prototype = beans was incomplete: ProxyFactoryBean and = AbstractPrototypeBasedTargetSource used = ConfigurableListableBeanFactory.getBeanDefinition(name).getBeanClass(), = which only regards the bean class of a specific bean definition. It did = not cover a couple of other configuration options: * a child bean definition that inherits the bean class from the parent * a FactoryBean (explicit check in ProxyFactoryBean, none in APBTS) * manually registered singletons (via registerSingleton) Therefore, I've added a "Class getType(name)" method to the BeanFactory = interface, trying to determine the type of the object returned by = getBean upfront. AbstractBeanFactory's default implementaton properly = merges bean definitions and handles FactoryBeans and manually registered = singletons. ProxyFactoryBean and AbstractPrototypeBasedTargetSource now just call = getType(name) to determine the target class, with a singleton or = prototype target. Note that getType is allowed to return null, just like = FactoryBean.getObjectType(), if it is not able to determine a proper = result class. The caller can then resort to getBean(name).getClass(), = creating a new prototype just for this; this is the caller's decision. Furthermore, I've added a "getBeansOfType(type)" convenience method to = ListableBeanFactory, matching all kinds of bean types. This is what most = callers will want to do, so it makes sense to offer this as a simplified = version (just like we do for getBean or getBeanDefinitionNames). = "getBeansOfType(type, includePrototypes, includeFactoryBeans)" still = allows for further customization of the result. Those changes should be perfectly backwards-compatible from an API point = of view. Just BeanFactory implementors will have to implement the new = methods, when compiling against the new Spring version. However, I = assume that hardly anyone implements custom bean factories that do not = extend from Spring's base classes... Essentially, the BeanFactory interface is an API, not an SPI, from a = backwards compatibility perspective, similar to JDBC or the J2EE = interfaces. Compare JDO 1.0.1, which introduced = PersistenceManager.close: perfectly backwards-compatible from an API = point of view, but requires implementors to provide the new "close" = method when compiling against the new API version. Juergen |
|
From: <jue...@we...> - 2004-10-04 12:12:19
|
Darren, =20 While this is certainly a worthwhile extension, I'm not sure if we = should raise the size of the Spring core distribution with a further 1.3 = MB jar file for such special functionality, in particular for a library = that is still in 0.x (i.e. whose API is not guaranteed to stay stable). = I'm a bit worried in that respect... Do you know what timeframe the next = FOP major release is scheduled for?=20 =20 Thus, I suggest to put the FOP support classes into the sandbox for the = time being... like we do for Commons Validator and co. People will use = it from there too, like they already do with the Commons Validator = support and the Portlet stuff... We can always move it over once we = agree that the time is right. Another option would be to start shipping = a separate extension distribution... =20 Opinions? (both on FOP support and the extension distribution idea...) =20 Juergen =20 _____ =20 Von: spr...@li... im Auftrag = von Darren Davison Gesendet: Mo 04.10.2004 11:16 An: spr...@li... Betreff: [Springframework-developer] XSL-FO (Apache-FOP) There have been a couple of posts in the forums about FOP ( http://forum.springframework.org/search.php?search = <http://forum.springframework.org/search.php?search&search_keywords=3Dfop= > &search_keywords=3Dfop) and we now have a similar requirement here in one of our projects. It's actually pretty trivial to implement when extending = AbstractXsltView but I think it's useful to include the generic parts in the framework. = Additional build dependencies include only fop.jar (~1.3MB) although the target app = will have to include batik.jar and the avalon framework jar as runtime = dependencies since FOP is hardlinked to Avalon logging in the current stable branch. = This will change to commons logging in the next major release. I'd like to commit this if there are no objections. No modifications = are required to existing framework classes and it could go in for 1.1.2 I = think. (Any comments welcome from those with significant FOP experience as I = don't have a great deal). -- Darren Davison Public Key: #DD356B0D ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give = us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out = more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |