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: Colin S. <col...@ex...> - 2003-10-15 21:46:00
|
Colin Sampaleanu wrote: > Rod Johnson wrote: > >>> W/regards to redefining TransactionAttributeSourceEditor to allow for >>> wildcards also in the classname, that's a useful feature, but the >>> internal workings of the class would have to change. Right now, using a >>> MethodMapTransactionAttributeSource, essentially all the methods of the >>> specified classes get added to the transactional method map (if they >>> match the method regex). So this approach wouldn't work for regexes at >>> the class level. You'd probably have to do matches at runtime, with >>> consequently slower performance (although I guess you could cache the >>> hits and misses, to alleviate this, making the performance pretty well >>> identical on second and subsequent calls to the same method). What do >>> you think of this idea >>> >> >> >> I prototyped such an approach a couple of months ago. The performance >> seemed >> not too bad. I haven't committed it. However, maybe I should when I get >> time, if people are interested. >> >> > I think this would be useful to some people (although the ability to > handle the 'all' case with another mechanism like the specialized > TransactionalAttributeSource would cover most of my needs).. > > If there are performance concerns, it could use a dual approach where > regexes on methods only (ie everything up to and including the class > name is specified) get handled as they do now, and other regexes get > handled with a runtime lookup with cache. My feeling is that the > runtime lookup with cache would perform well enough though. One > consideration is that the config semantics would change in terms of > typos. Right now MethodMapTransactionalAttributeSource gives you an > exception if you feed it a FQN which can't be resolved, or there are > no matching methods. I like the idea of detecting typos in this > fashion, if at all possible. Considering that your code may appear to > run fine even without the transaction, if you mess up the regex, I > think the error detection is valuable. So if the code is extended, > maybe one way to do it would be to have two sets of properties, one > which behaves exactly like the present property (config time regexes > on methods only), and a new one which adds runtime regex matching on > the package and class portion as well. > > Regards, > Colin For the time being I have added a new class MatchAllwaysTransactionAttributeSource, which will always return the same TransactionAttribute (which may be set, otherwise it will default to PROPOGATION_REQUIRED). I also tried to check in a unit test for it, but Eclipse barfed, then Tortoise as well on a re-attempt, with the error you get when there is a file in the attic wth the same name but a different case. This is definitely not the case, since this is a new file. Here's the error message from Tortoise. I don't know what to do since we don't have physical access to the repo to see what is going on. ----- In D:\src\open\spring-colin\spring: cvs -q commit -m "add MatchAllwaysTransactionAttributeSource, which returns the same TransactionAttribute for all methods" test/org/springframework/transaction/interceptor/MatchAllwaysTransactionAttributeSourceTest.java CVSROOT=:ext:co...@cv...:/cvsroot/springframework cvs: hash.c:312: findnode: Assertion `key != ((void *)0)' failed. cvs [server aborted]: received abort signal Error, CVS operation failed Tortoise Tip: This error can be caused because there used to be a file in the repository with a name differing only by case from the one you are adding. For example TEST.EXE rather than test.exe. To fix this go into the repository, or get your administrator to, and rename that file to have the same case. It will be in the Attic folder underneath the folder you are in. You will also need to get the local sandbox folder you are in out of CVS again, as it may have bogus entries to the misspelt filename. ----- |
|
From: <jue...@we...> - 2003-10-15 20:53:30
|
VGhlcmUncyBhIGJ1ZyBlbnRyeSBvbiBTb3VyY2VGb3JnZSByZWdhcmRpbmcgSGliZXJuYXRlVHJh bnNhY3Rpb25NYW5hZ2VyJ3MgY29tbWl0dGluZzoNCiANCklmIHRoZSBmbHVzaGluZyBvZiBjaGFu Z2VzIGlzIGRlbGF5ZWQgKGkuZS4gSGliZXJuYXRlVGVtcGxhdGUgaXMgaW4gRkxVU0hfQVVUTyBt b2RlLCBub3QgaW4gRkxVU0hfRUFHRVIpLCB0aGUgSGliZXJuYXRlIGNvbW1pdCBjYWxsIHdpbGwg Zmlyc3QgaW1wbGljdGx5IGNhdXNlIGEgZmx1c2guIFRoZSBwcm9ibGVtIGlzIHRoYXQgdGhhdCBm bHVzaCBtaWdodCB0aHJvdyBhbiBleGNlcHRpb24gd2hpY2ggY2F1c2VzIEhpYmVybmF0ZSdzIGNv bW1pdCBpbXBsZW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> - 2003-10-15 19:17:56
|
Has an expression language available for use in the app context ever been considered? (as per email below) -------- Original Message -------- Subject: Re: Spring XMLBeanFactory Date: Wed, 15 Oct 2003 15:14:42 -0400 From: Colin Sampaleanu <col...@ex...> To: Vladimir Blagojevic <vla...@cs...> References: <Pin...@bl...> It can't do this (to the best of my knowledge). There is an expression language available for use in the JSP tags, but this is not accessible in the contexts. If there is enough of a use case for this it could certainly be done. One way would be to try leveraging the existing expression language code. I have no idea how easy this would be to do since I've actually never touched the web ui code. Another mechanism would be to bring in something like OGNL, which is quite powerful... What is your usage scenario? Vladimir Blagojevic wrote: >Colin, > >Does XMLBeanFactory support reading property of bean X and assigning it >to bean Y within declarative xml config file? I don't think so, but is >there any chatter on the lists about that? > >Cheers > > > |
|
From: Colin S. <col...@ex...> - 2003-10-15 15:42:46
|
I agree. Just because I don't think source level transaction declarations don't make sense (for me, or for the general usecases), doesn't mean there are not some usecases where they probably do make sense. On top of that, there are a lot of other things (besides transaction declarations) you can do with source level (or bytecode level, post-compilation) metadata... Rod Johnson wrote: >Spring doesn't try to tell people what to think. So we should aim to please >both camps, and assume that users know best. (The customer is always right.) >We already have a solution for the "externalization" camp--and we should >improve it if we can. We now need to create a solution for the metadata >camp. > >R > >----- Original Message ----- >From: "Kopylenko, Dmitry" <dko...@su...> >To: "'Rod Johnson'" <rod...@in...>; "Kopylenko, Dmitry" ><dko...@su...> >Cc: <spr...@li...> >Sent: Wednesday, October 15, 2003 1:01 PM >Subject: RE: [Springframework-developer] new bean factory and application >context features > > >I tend to think so too. However there going to be "two camps" of people - >1)People who think source level metadata is a good thing > >2)People who think source level metadata is evil > >Dmitriy. > >-----Original Message----- >From: Rod Johnson [mailto:rod...@in...] >Sent: Wednesday, October 15, 2003 7:56 AM >To: Kopylenko, Dmitry >Cc: spr...@li... >Subject: Re: [Springframework-developer] new bean factory and application >context features > > >I think .NET does this well. I think it can simplify typical usage, without >sacrificing the ability to do more complex things externally. > >So I'm very keen to get it implemented--not too much work once we have >usable attributes--and give it a spin. > >Regards, >Rod > >----- Original Message ----- >From: "Kopylenko, Dmitry" <dko...@su...> >To: "'Colin Sampaleanu'" <col...@ex...> >Cc: "' '"jürgen höller [werk3AT]" ' '" <jue...@we...>; ><spr...@li...> >Sent: Wednesday, October 15, 2003 12:53 PM >Subject: RE: [Springframework-developer] new bean factory and application >context features > > >I guess it's -1 against the source level metadata use case. Well, since this >is a brand new concept (for java at least) what are everyone's >thoughts/feelings about it? > >Regards, >Dmitriy. > > >-----Original Message----- >From: Colin Sampaleanu [mailt:col...@ex...] >Sent: Tuesday, October 14, 2003 6:09 PM >To: Kopylenko, Dmitry >Cc: "'\"jürgen höller [werk3AT]\" '"; >'spr...@li... ' >Subject: Re: [Springframework-developer] new bean factory and application >context features > > >I suppose, although to tell you the truth I prefer to declare my >trnasactions separately from the source. Putting them in the source couples >things too closely for my taste, and makes management harder, given that I >want to change things around for unit tests and the like. > > >Kopylenko, Dmitry wrote: > > > >>Colin, >> >>that will be possible when the metadata support and "magic" >>TransactionAutoProxy creator will be in place ;-) >> >>Regards, >>Dmitriy. >> >>-----Original Message----- >>From: Colin Sampaleanu >>To: "jürgen höller [werk3AT]" >>Cc: spr...@li... >>Sent: 10/14/2003 5:49 PM >>Subject: Re: [Springframework-developer] new bean factory and >>application context features >> >>jürgen höller [werk3AT] wrote: >> >> >> >> >> >>>... >>> >>>This is a BeanPostProcessor bean that can be set up as follows to >>>proxy >>> >>> >>> >>> >>the beans with the given names with the given interceptors. Note that >>this is only one bean with proxy settings to define, although there >>might be dozens of target beans with the same proxy behavior. >> >> >> >> >>><bean id="autoProxyCreator" >>> >>> >>> >>> >>class="org.springframework.aop.framework.support.AutoProxyCreator"> >> >> >> >> >>><property >>> >>> >>> >>> >>name="beanNames"><value>myBean1,myBean2,myBean3</value></property> >> >> >> >> >>><property name="interceptors> >>> <list> >>> <ref bean="myInterceptor1"/> >>> <ref bean="myInterceptor2"/> >>> </list> >>></property> >>></bean> >>> >>>So setting up 10 transactional beans would just involve 1 >>> >>> >>> >>> >>AutoProxyCreator and 1 transaction interceptor plus the 10 target beans >>(12 beans in total), instead of 10 TransactionProxyFactoryBeans plus >>the 10 target beans (20 beans in total). The transaction attributes >>would be centralized though, in contrast to TransactionProxyFactoryBean >>that keeps them local per individual proxy definition. >> >> >> >> >>> >>> >>> >>> >>Hi Juergen, >> >>How do you see this being used (if at all) with the current >>TransactionInterceptor, since its TransactionAttributeSource property >>gets satisfied via a MethodMapTransactionAttributeSource instance >>(which >> >>needs definitions in the format 'FQN.methodName'). While this works >>fine >> >>when doing individual interceptors for use with ProxyFactoryBean, short >>of adding new code I'm at a loss as to how I could use >>TransactionInterceptor with BeanNameAutoProxy to do transactions on all >>methods in all the beans I feed to the auto proxy. >> >>Just wondering if I missed something? >> >>Regards, >>Colin >> >> |
|
From: Colin S. <col...@ex...> - 2003-10-15 15:32:51
|
Rod Johnson wrote: >>W/regards to redefining TransactionAttributeSourceEditor to allow for >>wildcards also in the classname, that's a useful feature, but the >>internal workings of the class would have to change. Right now, using a >>MethodMapTransactionAttributeSource, essentially all the methods of the >>specified classes get added to the transactional method map (if they >>match the method regex). So this approach wouldn't work for regexes at >>the class level. You'd probably have to do matches at runtime, with >>consequently slower performance (although I guess you could cache the >>hits and misses, to alleviate this, making the performance pretty well >>identical on second and subsequent calls to the same method). What do >>you think of this idea >> >> > >I prototyped such an approach a couple of months ago. The performance seemed >not too bad. I haven't committed it. However, maybe I should when I get >time, if people are interested. > > I think this would be useful to some people (although the ability to handle the 'all' case with another mechanism like the specialized TransactionalAttributeSource would cover most of my needs).. If there are performance concerns, it could use a dual approach where regexes on methods only (ie everything up to and including the class name is specified) get handled as they do now, and other regexes get handled with a runtime lookup with cache. My feeling is that the runtime lookup with cache would perform well enough though. One consideration is that the config semantics would change in terms of typos. Right now MethodMapTransactionalAttributeSource gives you an exception if you feed it a FQN which can't be resolved, or there are no matching methods. I like the idea of detecting typos in this fashion, if at all possible. Considering that your code may appear to run fine even without the transaction, if you mess up the regex, I think the error detection is valuable. So if the code is extended, maybe one way to do it would be to have two sets of properties, one which behaves exactly like the present property (config time regexes on methods only), and a new one which adds runtime regex matching on the package and class portion as well. Regards, Colin |
|
From: Rod J. <rod...@in...> - 2003-10-15 13:52:45
|
> W/regards to redefining TransactionAttributeSourceEditor to allow for > wildcards also in the classname, that's a useful feature, but the > internal workings of the class would have to change. Right now, using a > MethodMapTransactionAttributeSource, essentially all the methods of the > specified classes get added to the transactional method map (if they > match the method regex). So this approach wouldn't work for regexes at > the class level. You'd probably have to do matches at runtime, with > consequently slower performance (although I guess you could cache the > hits and misses, to alleviate this, making the performance pretty well > identical on second and subsequent calls to the same method). What do > you think of this idea I prototyped such an approach a couple of months ago. The performance seemed not too bad. I haven't committed it. However, maybe I should when I get time, if people are interested. |
|
From: Colin S. <col...@ex...> - 2003-10-15 13:41:11
|
The specialized TransactionAttributeSource approach would work fine.
This is obviously a trivial little class, but it would probably be worth
adding it to Spring itself (with the transaction attribute as a
parameter) so people could just create an instance as needed for this
type of usecase.
W/regards to redefining TransactionAttributeSourceEditor to allow for
wildcards also in the classname, that's a useful feature, but the
internal workings of the class would have to change. Right now, using a
MethodMapTransactionAttributeSource, essentially all the methods of the
specified classes get added to the transactional method map (if they
match the method regex). So this approach wouldn't work for regexes at
the class level. You'd probably have to do matches at runtime, with
consequently slower performance (although I guess you could cache the
hits and misses, to alleviate this, making the performance pretty well
identical on second and subsequent calls to the same method). What do
you think of this idea?
Regards,
Colin
jürgen höller [werk3AT] wrote:
>Colin,
>
>This is basically about a special TransactionAttributeSource implementation that would simply return the same TransactionAttribute for every method invocation. That should be easy enough to do:
>
>public class MyTransactionAttributeSource implements TransactionAttributeSource {
> public TransactionAttribute getTransactionAttribute(MethodInvocation invocation) {
> return new DefaultTransactionAttribute(TransactionDefinition.PROPAGATION_REQUIRED);
> }
>}
>
>Simply define it as a bean then, linking it to TransactionInterceptor's transactionAttributeSource property via a bean reference.
>
>As an alternative, we could refine the TransactionAttributeSourceEditor to allow for wildcards not only at the end of method names but already for the classname:
>
>not only "mypackage.MyClass.myMethod=PROPAGATION_REQUIRED"
>and "mypackage.MyClass.my*=PROPAGATION_REQUIRED"
>but also (at least) "*=PROPAGATION_REQUIRED"
>
>Juergen
>
>
> -----Ursprüngliche Nachricht-----
> Von: Colin Sampaleanu [mailto:col...@ex...]
> Gesendet: Mi 15.10.2003 03:31
> An: jürgen höller [werk3AT]
> Cc: spr...@li...
> Betreff: Re: [Springframework-developer] new bean factory and application context features
>
>
>
> Sure, that would work of course. I was thinking more along the lines of
> being able to handle at least the case of treating _everything_ with a
> set of specified transaction semantics (e.g. PROPOGATION_REQUIRED),
> without having to specify individual method matching regexes on each
> class. There is a use case (especially when you don't care about
> ultimate 'tuning' or when you want to defer that until later) for just
> turning on transactions for everything. This seems even more relevant
> when combine with BeanNameAutoProxy, so that you only have to add one
> simple bean ref in one place, and you have transactionional wrapping.
>
> In my case for example, this would happilly cover the majority of my
> transaction handling needs, with some fine tuning here and there (using
> TransactionProxyFactoryBean) for maybe the 10-20% of the remaining cases...
>
> Regards,
> Colin
>
>
>
>
>
>
>
|
|
From: Trevor C. <pr...@se...> - 2003-10-15 13:03:46
|
Not crazy, otherwise I am too :) Considering the maturity of the framework (even before it became Spring) as well as the responsiveness/talent of the core developers, we're treating Spring like internal code (not from an ownership level but from a trust perspective). Also, the previous "loose freeze" for public api changes means that (for the most part) the core has been pretty stable from an api-user's view for quite a while now. We're using the CVS version for our live app, and we too have found it very stable. We've also done a significant amount of testing of our main app (which in turn exercises a large portion of Spring). I've found a few minor bugs which have been fixed (by myself or others had already noticed them). The only outstanding bug we've found which affects our code is the nested bean problem (see http://sourceforge.net/mailarchive/forum.php?thread_id=3212995&forum_id=2840 1) but we worked around that by temporarily removing the object equals from a few objects (until we have time to look at/fix the bug). We're also using "latest/greatest" features such as the multipart stuff and are now implementing Juergen's new "multiple context/message files" (will eliminate the huge ant task we have to assemble a single xml file from modularized pieces). Trevor -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Kopylenko, Dmitry Sent: October 15, 2003 7:50 AM To: 'Rod Johnson'; 'spr...@li...' Subject: RE: [Springframework-developer] M2 Continuously testing CVS snapshots (actually we're developing phase 2 of our project against latest CVS snapshots. Kinda crazy, isn't it? :-) I can report it's VERY stable!!! Regards, Dmitriy. -----Original Message----- From: Rod Johnson [mailto:rod...@in...] Sent: Wednesday, October 15, 2003 5:54 AM To: spr...@li... Subject: [Springframework-developer] M2 All, Especially now that we're likely to get more downloads following the TSS article, it's essential that M2 is stable. Juergen suggested a few days ago that we all test a CVS snapshot in our apps. I second this. Can I also suggest a lockdown on core functionality until the M2 release (except for bug fixes and backward-compatible changes). This doesn't apply to attributes or anything that's an evolving area. Regards, Rod ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.525 / Virus Database: 322 - Release Date: 09/10/2003 |
|
From: Rod J. <rod...@in...> - 2003-10-15 12:05:28
|
Spring doesn't try to tell people what to think. So we should aim to please both camps, and assume that users know best. (The customer is always right.) We already have a solution for the "externalization" camp--and we should improve it if we can. We now need to create a solution for the metadata camp. R ----- Original Message ----- From: "Kopylenko, Dmitry" <dko...@su...> To: "'Rod Johnson'" <rod...@in...>; "Kopylenko, Dmitry" <dko...@su...> Cc: <spr...@li...> Sent: Wednesday, October 15, 2003 1:01 PM Subject: RE: [Springframework-developer] new bean factory and application context features I tend to think so too. However there going to be "two camps" of people - 1)People who think source level metadata is a good thing 2)People who think source level metadata is evil Dmitriy. -----Original Message----- From: Rod Johnson [mailto:rod...@in...] Sent: Wednesday, October 15, 2003 7:56 AM To: Kopylenko, Dmitry Cc: spr...@li... Subject: Re: [Springframework-developer] new bean factory and application context features I think .NET does this well. I think it can simplify typical usage, without sacrificing the ability to do more complex things externally. So I'm very keen to get it implemented--not too much work once we have usable attributes--and give it a spin. Regards, Rod ----- Original Message ----- From: "Kopylenko, Dmitry" <dko...@su...> To: "'Colin Sampaleanu'" <col...@ex...> Cc: "' '"jürgen höller [werk3AT]" ' '" <jue...@we...>; <spr...@li...> Sent: Wednesday, October 15, 2003 12:53 PM Subject: RE: [Springframework-developer] new bean factory and application context features I guess it's -1 against the source level metadata use case. Well, since this is a brand new concept (for java at least) what are everyone's thoughts/feelings about it? Regards, Dmitriy. -----Original Message----- From: Colin Sampaleanu [mailt:col...@ex...] Sent: Tuesday, October 14, 2003 6:09 PM To: Kopylenko, Dmitry Cc: "'\"jürgen höller [werk3AT]\" '"; 'spr...@li... ' Subject: Re: [Springframework-developer] new bean factory and application context features I suppose, although to tell you the truth I prefer to declare my trnasactions separately from the source. Putting them in the source couples things too closely for my taste, and makes management harder, given that I want to change things around for unit tests and the like. Kopylenko, Dmitry wrote: >Colin, > >that will be possible when the metadata support and "magic" >TransactionAutoProxy creator will be in place ;-) > >Regards, >Dmitriy. > >-----Original Message----- >From: Colin Sampaleanu >To: "jürgen höller [werk3AT]" >Cc: spr...@li... >Sent: 10/14/2003 5:49 PM >Subject: Re: [Springframework-developer] new bean factory and >application context features > >jürgen höller [werk3AT] wrote: > > > >>... >> >>This is a BeanPostProcessor bean that can be set up as follows to >>proxy >> >> >the beans with the given names with the given interceptors. Note that >this is only one bean with proxy settings to define, although there >might be dozens of target beans with the same proxy behavior. > > >><bean id="autoProxyCreator" >> >> >class="org.springframework.aop.framework.support.AutoProxyCreator"> > > >> <property >> >> >name="beanNames"><value>myBean1,myBean2,myBean3</value></property> > > >> <property name="interceptors> >> <list> >> <ref bean="myInterceptor1"/> >> <ref bean="myInterceptor2"/> >> </list> >> </property> >></bean> >> >>So setting up 10 transactional beans would just involve 1 >> >> >AutoProxyCreator and 1 transaction interceptor plus the 10 target beans >(12 beans in total), instead of 10 TransactionProxyFactoryBeans plus >the 10 target beans (20 beans in total). The transaction attributes >would be centralized though, in contrast to TransactionProxyFactoryBean >that keeps them local per individual proxy definition. > > >> >> >> >> >Hi Juergen, > >How do you see this being used (if at all) with the current >TransactionInterceptor, since its TransactionAttributeSource property >gets satisfied via a MethodMapTransactionAttributeSource instance >(which > >needs definitions in the format 'FQN.methodName'). While this works >fine > >when doing individual interceptors for use with ProxyFactoryBean, short >of adding new code I'm at a loss as to how I could use >TransactionInterceptor with BeanNameAutoProxy to do transactions on all >methods in all the beans I feed to the auto proxy. > >Just wondering if I missed something? > >Regards, >Colin > > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >SourceForge.net hosts over 70,000 Open Source Projects. See the people >who have HELPED US provide better services: Click here: >http://sourceforge.net/supporters.php >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-15 12:01:42
|
I tend to think so too. However there going to be "two camps" of people = - 1)People who think source level metadata is a good thing =09 2)People who think source level metadata is evil Dmitriy. -----Original Message----- From: Rod Johnson [mailto:rod...@in...]=20 Sent: Wednesday, October 15, 2003 7:56 AM To: Kopylenko, Dmitry Cc: spr...@li... Subject: Re: [Springframework-developer] new bean factory and = application context features I think .NET does this well. I think it can simplify typical usage, = without sacrificing the ability to do more complex things externally. So I'm very keen to get it implemented--not too much work once we have usable attributes--and give it a spin. Regards, Rod ----- Original Message -----=20 From: "Kopylenko, Dmitry" <dko...@su...> To: "'Colin Sampaleanu'" <col...@ex...> Cc: "' '"j=FCrgen h=F6ller [werk3AT]" ' '" = <jue...@we...>; <spr...@li...> Sent: Wednesday, October 15, 2003 12:53 PM Subject: RE: [Springframework-developer] new bean factory and = application context features I guess it's -1 against the source level metadata use case. Well, since = this is a brand new concept (for java at least) what are everyone's thoughts/feelings about it? Regards, Dmitriy. -----Original Message----- From: Colin Sampaleanu [mailt:col...@ex...] Sent: Tuesday, October 14, 2003 6:09 PM To: Kopylenko, Dmitry Cc: "'\"j=FCrgen h=F6ller [werk3AT]\" '"; 'spr...@li... ' Subject: Re: [Springframework-developer] new bean factory and = application context features I suppose, although to tell you the truth I prefer to declare my trnasactions separately from the source. Putting them in the source = couples things too closely for my taste, and makes management harder, given = that I want to change things around for unit tests and the like. Kopylenko, Dmitry wrote: >Colin, > >that will be possible when the metadata support and "magic"=20 >TransactionAutoProxy creator will be in place ;-) > >Regards, >Dmitriy. > >-----Original Message----- >From: Colin Sampaleanu >To: "j=FCrgen h=F6ller [werk3AT]" >Cc: spr...@li... >Sent: 10/14/2003 5:49 PM >Subject: Re: [Springframework-developer] new bean factory and=20 >application context features > >j=FCrgen h=F6ller [werk3AT] wrote: > > > >>... >> >>This is a BeanPostProcessor bean that can be set up as follows to=20 >>proxy >> >> >the beans with the given names with the given interceptors. Note that=20 >this is only one bean with proxy settings to define, although there=20 >might be dozens of target beans with the same proxy behavior. > > >><bean id=3D"autoProxyCreator" >> >> >class=3D"org.springframework.aop.framework.support.AutoProxyCreator"> > > >> <property >> >> >name=3D"beanNames"><value>myBean1,myBean2,myBean3</value></property> > > >> <property name=3D"interceptors> >> <list> >> <ref bean=3D"myInterceptor1"/> >> <ref bean=3D"myInterceptor2"/> >> </list> >> </property> >></bean> >> >>So setting up 10 transactional beans would just involve 1 >> >> >AutoProxyCreator and 1 transaction interceptor plus the 10 target = beans=20 >(12 beans in total), instead of 10 TransactionProxyFactoryBeans plus=20 >the 10 target beans (20 beans in total). The transaction attributes=20 >would be centralized though, in contrast to = TransactionProxyFactoryBean=20 >that keeps them local per individual proxy definition. > > >> >> >> >> >Hi Juergen, > >How do you see this being used (if at all) with the current=20 >TransactionInterceptor, since its TransactionAttributeSource property=20 >gets satisfied via a MethodMapTransactionAttributeSource instance=20 >(which > >needs definitions in the format 'FQN.methodName'). While this works=20 >fine > >when doing individual interceptors for use with ProxyFactoryBean, = short=20 >of adding new code I'm at a loss as to how I could use=20 >TransactionInterceptor with BeanNameAutoProxy to do transactions on = all=20 >methods in all the beans I feed to the auto proxy. > >Just wondering if I missed something? > >Regards, >Colin > > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program.=20 >SourceForge.net hosts over 70,000 Open Source Projects. See the people = >who have HELPED US provide better services: Click here:=20 >http://sourceforge.net/supporters.php >_______________________________________________ >Springframework-developer mailing list=20 >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. = SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED = US provide better services: Click here: = http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <rod...@in...> - 2003-10-15 11:56:35
|
I think .NET does this well. I think it can simplify typical usage, without sacrificing the ability to do more complex things externally. So I'm very keen to get it implemented--not too much work once we have usable attributes--and give it a spin. Regards, Rod ----- Original Message ----- From: "Kopylenko, Dmitry" <dko...@su...> To: "'Colin Sampaleanu'" <col...@ex...> Cc: "' '"jürgen höller [werk3AT]" ' '" <jue...@we...>; <spr...@li...> Sent: Wednesday, October 15, 2003 12:53 PM Subject: RE: [Springframework-developer] new bean factory and application context features I guess it's -1 against the source level metadata use case. Well, since this is a brand new concept (for java at least) what are everyone's thoughts/feelings about it? Regards, Dmitriy. -----Original Message----- From: Colin Sampaleanu [mailt:col...@ex...] Sent: Tuesday, October 14, 2003 6:09 PM To: Kopylenko, Dmitry Cc: "'\"jürgen höller [werk3AT]\" '"; 'spr...@li... ' Subject: Re: [Springframework-developer] new bean factory and application context features I suppose, although to tell you the truth I prefer to declare my trnasactions separately from the source. Putting them in the source couples things too closely for my taste, and makes management harder, given that I want to change things around for unit tests and the like. Kopylenko, Dmitry wrote: >Colin, > >that will be possible when the metadata support and "magic" >TransactionAutoProxy creator will be in place ;-) > >Regards, >Dmitriy. > >-----Original Message----- >From: Colin Sampaleanu >To: "jürgen höller [werk3AT]" >Cc: spr...@li... >Sent: 10/14/2003 5:49 PM >Subject: Re: [Springframework-developer] new bean factory and >application context features > >jürgen höller [werk3AT] wrote: > > > >>... >> >>This is a BeanPostProcessor bean that can be set up as follows to >>proxy >> >> >the beans with the given names with the given interceptors. Note that >this is only one bean with proxy settings to define, although there >might be dozens of target beans with the same proxy behavior. > > >><bean id="autoProxyCreator" >> >> >class="org.springframework.aop.framework.support.AutoProxyCreator"> > > >> <property >> >> >name="beanNames"><value>myBean1,myBean2,myBean3</value></property> > > >> <property name="interceptors> >> <list> >> <ref bean="myInterceptor1"/> >> <ref bean="myInterceptor2"/> >> </list> >> </property> >></bean> >> >>So setting up 10 transactional beans would just involve 1 >> >> >AutoProxyCreator and 1 transaction interceptor plus the 10 target beans >(12 beans in total), instead of 10 TransactionProxyFactoryBeans plus >the 10 target beans (20 beans in total). The transaction attributes >would be centralized though, in contrast to TransactionProxyFactoryBean >that keeps them local per individual proxy definition. > > >> >> >> >> >Hi Juergen, > >How do you see this being used (if at all) with the current >TransactionInterceptor, since its TransactionAttributeSource property >gets satisfied via a MethodMapTransactionAttributeSource instance (which > >needs definitions in the format 'FQN.methodName'). While this works >fine > >when doing individual interceptors for use with ProxyFactoryBean, short >of adding new code I'm at a loss as to how I could use >TransactionInterceptor with BeanNameAutoProxy to do transactions on all >methods in all the beans I feed to the auto proxy. > >Just wondering if I missed something? > >Regards, >Colin > > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >SourceForge.net hosts over 70,000 Open Source Projects. See the people >who have HELPED US provide better services: Click here: >http://sourceforge.net/supporters.php >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-15 11:53:56
|
I guess it's -1 against the source level metadata use case. Well, since = this is a brand new concept (for java at least) what are everyone's thoughts/feelings about it? Regards, Dmitriy. -----Original Message----- From: Colin Sampaleanu [mailto:col...@ex...]=20 Sent: Tuesday, October 14, 2003 6:09 PM To: Kopylenko, Dmitry Cc: "'\"j=FCrgen h=F6ller [werk3AT]\" '"; 'spr...@li... ' Subject: Re: [Springframework-developer] new bean factory and = application context features I suppose, although to tell you the truth I prefer to declare my=20 trnasactions separately from the source. Putting them in the source=20 couples things too closely for my taste, and makes management harder,=20 given that I want to change things around for unit tests and the like. Kopylenko, Dmitry wrote: >Colin, > >that will be possible when the metadata support and "magic"=20 >TransactionAutoProxy creator will be in place ;-) > >Regards, >Dmitriy. > >-----Original Message----- >From: Colin Sampaleanu >To: "j=FCrgen h=F6ller [werk3AT]" >Cc: spr...@li... >Sent: 10/14/2003 5:49 PM >Subject: Re: [Springframework-developer] new bean factory and=20 >application context features > >j=FCrgen h=F6ller [werk3AT] wrote: > > =20 > >>... >> >>This is a BeanPostProcessor bean that can be set up as follows to=20 >>proxy >> =20 >> >the beans with the given names with the given interceptors. Note that=20 >this is only one bean with proxy settings to define, although there=20 >might be dozens of target beans with the same proxy behavior. > =20 > >><bean id=3D"autoProxyCreator" >> =20 >> >class=3D"org.springframework.aop.framework.support.AutoProxyCreator"> > =20 > >> <property >> =20 >> >name=3D"beanNames"><value>myBean1,myBean2,myBean3</value></property> > =20 > >> <property name=3D"interceptors> >> <list> >> <ref bean=3D"myInterceptor1"/> >> <ref bean=3D"myInterceptor2"/> >> </list> >> </property> >></bean> >> >>So setting up 10 transactional beans would just involve 1 >> =20 >> >AutoProxyCreator and 1 transaction interceptor plus the 10 target = beans=20 >(12 beans in total), instead of 10 TransactionProxyFactoryBeans plus=20 >the 10 target beans (20 beans in total). The transaction attributes=20 >would be centralized though, in contrast to = TransactionProxyFactoryBean=20 >that keeps them local per individual proxy definition. > =20 > >>=20 >> >> =20 >> >Hi Juergen, > >How do you see this being used (if at all) with the current >TransactionInterceptor, since its TransactionAttributeSource property=20 >gets satisfied via a MethodMapTransactionAttributeSource instance = (which > >needs definitions in the format 'FQN.methodName'). While this works=20 >fine > >when doing individual interceptors for use with ProxyFactoryBean, = short >of adding new code I'm at a loss as to how I could use=20 >TransactionInterceptor with BeanNameAutoProxy to do transactions on = all=20 >methods in all the beans I feed to the auto proxy. > >Just wondering if I missed something? > >Regards, >Colin > > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program.=20 >SourceForge.net hosts over 70,000 Open Source Projects. See the people = >who have HELPED US provide better services: Click here:=20 >http://sourceforge.net/supporters.php >_______________________________________________ >Springframework-developer mailing list=20 >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > =20 > |
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-15 11:50:13
|
Continuously testing CVS snapshots (actually we're developing phase 2 of our project against latest CVS snapshots. Kinda crazy, isn't it? :-) I can report it's VERY stable!!! Regards, Dmitriy. -----Original Message----- From: Rod Johnson [mailto:rod...@in...] Sent: Wednesday, October 15, 2003 5:54 AM To: spr...@li... Subject: [Springframework-developer] M2 All, Especially now that we're likely to get more downloads following the TSS article, it's essential that M2 is stable. Juergen suggested a few days ago that we all test a CVS snapshot in our apps. I second this. Can I also suggest a lockdown on core functionality until the M2 release (except for bug fixes and backward-compatible changes). This doesn't apply to attributes or anything that's an evolving area. Regards, Rod ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <rod...@in...> - 2003-10-15 09:55:51
|
> if someone better qualified doesn't put their hand up, I'd also be pleased to > try to take this on too. Darren, If you'd like to take ownership of this that would be great. I think a short proposal (one page or so of text) would be great so that we can all review the proposed strategy before getting down to implementation. Regards, Rod |
|
From: Rod J. <rod...@in...> - 2003-10-15 09:54:12
|
All, Especially now that we're likely to get more downloads following the TSS article, it's essential that M2 is stable. Juergen suggested a few days ago that we all test a CVS snapshot in our apps. I second this. Can I also suggest a lockdown on core functionality until the M2 release (except for bug fixes and backward-compatible changes). This doesn't apply to attributes or anything that's an evolving area. Regards, Rod |
|
From: <jue...@we...> - 2003-10-15 08:20:21
|
Q29saW4sDQogDQpUaGlzIGlzIGJhc2ljYWxseSBhYm91dCBhIHNwZWNpYWwgVHJhbnNhY3Rpb25B dHRyaWJ1dGVTb3VyY2UgaW1wbGVtZW50YXRpb24gdGhhdCB3b3VsZCBzaW1wbHkgcmV0dXJuIHRo ZSBzYW1lIFRyYW5zYWN0aW9uQXR0cmlidXRlIGZvciBldmVyeSBtZXRob2QgaW52b2NhdGlvbi4g VGhhdCBzaG91bGQgYmUgZWFzeSBlbm91Z2ggdG8gZG86DQogDQpwdWJsaWMgY2xhc3MgTXlUcmFu c2FjdGlvbkF0dHJpYnV0ZVNvdXJjZSBpbXBsZW1lbnRzIFRyYW5zYWN0aW9uQXR0cmlidXRlU291 cmNlIHsNCiAgcHVibGljIFRyYW5zYWN0aW9uQXR0cmlidXRlIGdldFRyYW5zYWN0aW9uQXR0cmli dXRlKE1ldGhvZEludm9jYXRpb24gaW52b2NhdGlvbikgew0KICAgIHJldHVybiB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0aGUgbWFqb3JpdHkgb2YgbXkNCgl0cmFuc2FjdGlvbiBo YW5kbGluZyBuZWVkcywgd2l0aCBzb21lIGZpbmUgdHVuaW5nIGhlcmUgYW5kIHRoZXJlICh1c2lu Zw0KCVRyYW5zYWN0aW9uUHJveHlGYWN0b3J5QmVhbikgZm9yIG1heWJlIHRoZSAxMC0yMCUgb2Yg dGhlIHJlbWFpbmluZyBjYXNlcy4uLg0KCQ0KCVJlZ2FyZHMsDQoJQ29saW4NCgkNCgkNCgkNCgkN Cg0K |
|
From: Colin S. <col...@ex...> - 2003-10-15 01:31:27
|
jürgen höller [werk3AT] wrote: >Colin, > > > >>How do you see this being used (if at all) with the current >> >> >TransactionInterceptor, since its TransactionAttributeSource property >gets satisfied via a MethodMapTransactionAttributeSource instance (which >needs definitions in the format 'FQN.methodName'). While this works fine >when doing individual interceptors for use with ProxyFactoryBean, short >of adding new code I'm at a loss as to how I could use >TransactionInterceptor with BeanNameAutoProxy to do transactions on all >methods in all the beans I feed to the auto proxy. > >You need to use one shared TransactionInterceptor instance here, defining the attributes for the transactional methods of all the interfaces and classes involved: ><bean id="exampleTransactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> > <property name="transactionManager"><ref bean="myTransactionManager"/></property> > <property name="transactionAttributeSource"> > <value> > example.ExampleBusinessInterface.exampleMethod=PROPAGATION_REQUIRED > example.ExampleBusinessInterface.anotherExampleMethod=PROPAGATION_REQUIRED > example.AnotherExampleBusinessInterface.exampleMethod=PROPAGATION_REQUIRED > </value> > </property> ></bean> > >That should work with multiple ProxyFactoryBeans that reference one single TransactionInterceptor, and thus also with BeanNameAutoProxyCreator. > > > Sure, that would work of course. I was thinking more along the lines of being able to handle at least the case of treating _everything_ with a set of specified transaction semantics (e.g. PROPOGATION_REQUIRED), without having to specify individual method matching regexes on each class. There is a use case (especially when you don't care about ultimate 'tuning' or when you want to defer that until later) for just turning on transactions for everything. This seems even more relevant when combine with BeanNameAutoProxy, so that you only have to add one simple bean ref in one place, and you have transactionional wrapping. In my case for example, this would happilly cover the majority of my transaction handling needs, with some fine tuning here and there (using TransactionProxyFactoryBean) for maybe the 10-20% of the remaining cases... Regards, Colin |
|
From: <jue...@we...> - 2003-10-14 22:55:16
|
Q29saW4sDQogDQo+IEhvdyBkbyB5b3Ugc2VlIHRoaXMgYmVpbmcgdXNlZCAoaWYgYXQgYWxsKSB3 aXRoIHRoZSBjdXJyZW50DQpUcmFuc2FjdGlvbkludGVyY2VwdG9yLCBzaW5jZSBpdHMgVHJhbnNh Y3Rpb25BdHRyaWJ1dGVTb3VyY2UgcHJvcGVydHkNCmdldHMgc2F0aXNmaWVkIHZpYSBhIE1ldGhv ZE1hcFRyYW5zYWN0aW9uQXR0cmlidXRlU291cmNlIGluc3RhbmNlICh3aGljaA0KbmVlZHMgZGVm aW5pdGlvbnMgaW4gdGhlIGZvcm1hdCAnRlFOLm1ldGhvZE5hbWUnKS4gV2hpbGUgdGhpcyB3b3Jr cyBmaW5lDQp3aGVuIGRvaW5nIGluZGl2aWR1YWwgaW50ZXJjZXB0b3JzIGZvciB1c2Ugd2l0aCBQ cm94eUZhY3RvcnlCZWFuLCBzaG9ydA0Kb2YgYWRkaW5nIG5ldyBjb2RlIEknbSBhdCBhIGxvc3Mg YXMgdG8gaG93IEkgY291bGQgdXNlDQpUcmFuc2FjdGlvbkludGVyY2VwdG9yIHdpdGggQmVhbk5h bWVBdXRvUHJveHkgdG8gZG8gdHJhbnNhY3Rpb25zIG9uIGFsbA0KbWV0aG9kcyBpbiBhbGwgdGhl IGJlYW5zIEkgZmVlZCB0byB0aGUgYXV0byBwcm94eS4NCg0KWW91IG5lZWQgdG8gdXNlIG9uZSBz aGFyZWQgVHJhbnNhY3Rpb25JbnRlcmNlcHRvciBpbnN0YW5jZSBoZXJlLCBkZWZpbmluZyB0aGUg YXR0cmlidXRlcyBmb3IgdGhlIHRyYW5zYWN0aW9uYWwgbWV0aG9kcyBvZiBhbGwgdGhlIGludGVy ZmFjZXMgYW5kIGNsYXNzZXMgaW52b2x2ZWQ6DQo8YmVhbiBpZD0iZXhhbXBsZVRyYW5zYWN0aW9u SW50ZXJjZXB0b3IiIGNsYXNzPSJvcmcuc3ByaW5nZnJhbWV3b3JrLnRyYW5zYWN0aW9uLmludGVy Y2VwdG9yLlRyYW5zYWN0aW9uSW50ZXJjZXB0b3IiPg0KICA8cHJvcGVydHkgbmFtZT0idHJhbnNh Y3Rpb25NYW5hZ2VyIj48cmVmIGJlYW49Im15VHJhbnNhY3Rpb25NYW5hZ2VyIi8+PC9wcm9wZXJ0 eT4NCiAgPHByb3BlcnR5IG5hbWU9InRyYW5zYWN0aW9uQXR0cmlidXRlU291cmNlIj4NCiAgICA8 dmFsdWU+DQogICAgICBleGFtcGxlLkV4YW1wbGVCdXNpbmVzc0ludGVyZmFjZS5leGFtcGxlTWV0 aG9kPVBST1BBR0FUSU9OX1JFUVVJUkVEDQogICAgICBleGFtcGxlLkV4YW1wbGVCdXNpbmVzc0lu dGVyZmFjZS5hbm90aGVyRXhhbXBsZU1ldGhvZD1QUk9QQUdBVElPTl9SRVFVSVJFRA0KICAgICAg ZXhhbXBsZS5Bbm90aGVyRXhhbXBsZUJ1c2luZXNzSW50ZXJmYWNlLmV4YW1wbGVNZXRob2Q9UFJP UEFHQVRJT05fUkVRVUlSRUQNCiAgICA8L3ZhbHVlPg0KICA8L3Byb3BlcnR5Pg0KPC9iZWFuPg0K DQpUaGF0IHNob3VsZCB3b3JrIHdpdGggbXVsdGlwbGUgUHJveHlGYWN0b3J5QmVhbnMgdGhhdCBy ZWZlcmVuY2Ugb25lIHNpbmdsZSBUcmFuc2FjdGlvbkludGVyY2VwdG9yLCBhbmQgdGh1cyBhbHNv IHdpdGggQmVhbk5hbWVBdXRvUHJveHlDcmVhdG9yLg0KIA0KSnVlcmdlbg0KIA0K |
|
From: Colin S. <col...@ex...> - 2003-10-14 22:08:34
|
I suppose, although to tell you the truth I prefer to declare my trnasactions separately from the source. Putting them in the source couples things too closely for my taste, and makes management harder, given that I want to change things around for unit tests and the like. Kopylenko, Dmitry wrote: >Colin, > >that will be possible when the metadata support and "magic" >TransactionAutoProxy creator will be in place ;-) > >Regards, >Dmitriy. > >-----Original Message----- >From: Colin Sampaleanu >To: "jürgen höller [werk3AT]" >Cc: spr...@li... >Sent: 10/14/2003 5:49 PM >Subject: Re: [Springframework-developer] new bean factory and application >context features > >jürgen höller [werk3AT] wrote: > > > >>... >> >>This is a BeanPostProcessor bean that can be set up as follows to proxy >> >> >the beans with the given names with the given interceptors. Note that >this is only one bean with proxy settings to define, although there >might be dozens of target beans with the same proxy behavior. > > >><bean id="autoProxyCreator" >> >> >class="org.springframework.aop.framework.support.AutoProxyCreator"> > > >> <property >> >> >name="beanNames"><value>myBean1,myBean2,myBean3</value></property> > > >> <property name="interceptors> >> <list> >> <ref bean="myInterceptor1"/> >> <ref bean="myInterceptor2"/> >> </list> >> </property> >></bean> >> >>So setting up 10 transactional beans would just involve 1 >> >> >AutoProxyCreator and 1 transaction interceptor plus the 10 target beans >(12 beans in total), instead of 10 TransactionProxyFactoryBeans plus the >10 target beans (20 beans in total). The transaction attributes would be >centralized though, in contrast to TransactionProxyFactoryBean that >keeps them local per individual proxy definition. > > >> >> >> >> >Hi Juergen, > >How do you see this being used (if at all) with the current >TransactionInterceptor, since its TransactionAttributeSource property >gets satisfied via a MethodMapTransactionAttributeSource instance (which > >needs definitions in the format 'FQN.methodName'). While this works fine > >when doing individual interceptors for use with ProxyFactoryBean, short >of adding new code I'm at a loss as to how I could use >TransactionInterceptor with BeanNameAutoProxy to do transactions on all >methods in all the beans I feed to the auto proxy. > >Just wondering if I missed something? > >Regards, >Colin > > > > >------------------------------------------------------- >This SF.net email is sponsored by: SF.net Giveback Program. >SourceForge.net hosts over 70,000 Open Source Projects. >See the people who have HELPED US provide better services: >Click here: http://sourceforge.net/supporters.php >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-14 22:04:21
|
Colin, that will be possible when the metadata support and "magic" TransactionAutoProxy creator will be in place ;-) Regards, Dmitriy. -----Original Message----- From: Colin Sampaleanu To: "j=C3=BCrgen h=C3=B6ller [werk3AT]" Cc: spr...@li... Sent: 10/14/2003 5:49 PM Subject: Re: [Springframework-developer] new bean factory and = application context features j=C3=BCrgen h=C3=B6ller [werk3AT] wrote: >... > >This is a BeanPostProcessor bean that can be set up as follows to = proxy the beans with the given names with the given interceptors. Note that this is only one bean with proxy settings to define, although there might be dozens of target beans with the same proxy behavior. > ><bean id=3D"autoProxyCreator" class=3D"org.springframework.aop.framework.support.AutoProxyCreator"> > <property name=3D"beanNames"><value>myBean1,myBean2,myBean3</value></property> > <property name=3D"interceptors> > <list> > <ref bean=3D"myInterceptor1"/> > <ref bean=3D"myInterceptor2"/> > </list> > </property> ></bean> > >So setting up 10 transactional beans would just involve 1 AutoProxyCreator and 1 transaction interceptor plus the 10 target beans (12 beans in total), instead of 10 TransactionProxyFactoryBeans plus = the 10 target beans (20 beans in total). The transaction attributes would = be centralized though, in contrast to TransactionProxyFactoryBean that keeps them local per individual proxy definition. >=20 > =20 > Hi Juergen, How do you see this being used (if at all) with the current=20 TransactionInterceptor, since its TransactionAttributeSource property=20 gets satisfied via a MethodMapTransactionAttributeSource instance = (which needs definitions in the format 'FQN.methodName'). While this works = fine when doing individual interceptors for use with ProxyFactoryBean, short = of adding new code I'm at a loss as to how I could use=20 TransactionInterceptor with BeanNameAutoProxy to do transactions on all = methods in all the beans I feed to the auto proxy. Just wondering if I missed something? Regards, Colin ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2003-10-14 21:49:22
|
jürgen höller [werk3AT] wrote: >... > >This is a BeanPostProcessor bean that can be set up as follows to proxy the beans with the given names with the given interceptors. Note that this is only one bean with proxy settings to define, although there might be dozens of target beans with the same proxy behavior. > ><bean id="autoProxyCreator" class="org.springframework.aop.framework.support.AutoProxyCreator"> > <property name="beanNames"><value>myBean1,myBean2,myBean3</value></property> > <property name="interceptors> > <list> > <ref bean="myInterceptor1"/> > <ref bean="myInterceptor2"/> > </list> > </property> ></bean> > >So setting up 10 transactional beans would just involve 1 AutoProxyCreator and 1 transaction interceptor plus the 10 target beans (12 beans in total), instead of 10 TransactionProxyFactoryBeans plus the 10 target beans (20 beans in total). The transaction attributes would be centralized though, in contrast to TransactionProxyFactoryBean that keeps them local per individual proxy definition. > > > Hi Juergen, How do you see this being used (if at all) with the current TransactionInterceptor, since its TransactionAttributeSource property gets satisfied via a MethodMapTransactionAttributeSource instance (which needs definitions in the format 'FQN.methodName'). While this works fine when doing individual interceptors for use with ProxyFactoryBean, short of adding new code I'm at a loss as to how I could use TransactionInterceptor with BeanNameAutoProxy to do transactions on all methods in all the beans I feed to the auto proxy. Just wondering if I missed something? Regards, Colin |
|
From: Rod J. <rod...@in...> - 2003-10-14 18:56:20
|
TSS have just published my article on Spring. Thanks to Alef, Dmitriy for reviewing it and Colin for providing some material about Hibernate. Regards, Rod |
|
From: Trevor C. <pr...@se...> - 2003-10-14 13:32:50
|
Not "just a distributed one", this team honestly is alot better than =
that (and you personally have put a ton into this thing, which I am =
indebted to you for). At work I only get to choose the best and =
brightest within commuting distance, here we have a global pool. Our =
other advantage is that nobody has to help (paycheque, etc.), so it's =
all pride and passion. Plus no interruptions when somebody wants to =
borrow a stapler, etc. (fill in all your favorite Dilbert cartoons here =
:) ).
Anyway, the additional functionality is a bean which determines the =
"MaximumFileSize" based on the user who is logged in (using the standard =
"request.getUserPrincipal()") . Our app has multiple roles, and we =
allow "small" upload sizes to the public, variable sizes to different =
business partners (for product lists, etc.), and unlimited sizes to the =
administrators (us and our clients). It requires creating a =
"DiskFileUpload" for every multipart request, but it gives us a lot of =
flexibility.
Trevor
-----Original Message-----
From: j=C3=BCrgen h=C3=B6ller [werk3AT] =
[mailto:jue...@we...]
Sent: October 14, 2003 9:14 AM
To: Trevor Cook; Spring Developers
Subject: RE: [Springframework-developer] Multipart File Handling
The separating line in my original mail actually means about 2 hours =
inbetween... enough time to do intense code checks and some serious =
reconsideration. I still have to smile myself when I look at that again =
;-)
The arguments didn't flip completely BTW, just in terms of dismissing =
PropertyEditor as a whole: We don't use intermediate String =
representations via request.getParameter anymore, which was my main =
intent.
I'm glad that you're happy with it now. I'm too, actually! That's the =
great thing about working in a team, even if "just" a distributed one: =
Multiple points of view can create much better solutions than a single =
mind ever could.
Just out of curiosity: What additional functionality did you add to =
CommonsMultipartResolver?
Juergen
-----Original Message-----
From: Trevor Cook [mailto:pr...@se...]
Sent: Tuesday, October 14, 2003 3:06 PM
To: jrgen h ller [werk3AT]; Spring Developers
Subject: RE: [Springframework-developer] Multipart File Handling
It is interesting seeing your arguments flip 180 degrees in a few =
paragraphs, but you're not alone there. I find the same thing, that =
talking helps me find my own solutions.
As far as the implementation goes, the changes are perfect. It's a lot =
cleaner than my original version (no coupling with DispatcherServlet or =
property editors), but we still have the benefit of custom property =
handling.
I've migrated our project from the original multipart to the new =
version, and everything works great. My code uses "standard" handling =
(byte[] and MultipartFile) as well as the custom property editors. I've =
also subclassed the CommonsMultipartResolver to provide some additional =
functionality in our app, and that works perfect as well.
I think we have a winner :)
Trevor D. Cook
-----Original Message-----
From: jrgen h ller [werk3AT] [mailto:jue...@we...]
Sent: October 14, 2003 1:13 AM
To: jrgen h ller [werk3AT]; Trevor Cook; Spring Developers
Subject: Re: [Springframework-developer] Multipart File Handling
P.S.: Funny how the direction of an own argument can change in the =
course of a single email ;-) Of course, I was talking about =
PropertyEditor's setAsText (and the indirection with String values that =
match field names) in the first paragraph, and haven't had realized at =
that time that there was the completely different setValue option too...
=20
Juergen
=20
-----Ursprngliche Nachricht-----=20
Von: j rgen hller [werk3AT]=20
Gesendet: Di 14.10.2003 01:26=20
An: Trevor Cook; Spring Developers=20
Cc:=20
Betreff: Re: [Springframework-developer] Multipart File Handling
=09
=09
Trevor,
=09
Sorry if I've been a bit eager in terms of getting rid of the =
PropertyEditor stuff for multipart files. I strongly believe that the =
JavaBeans PropertyEditor is not appropriate for multipart files though, =
as it is about converting *String* parameters to other types. This is =
fine for standard ServletRequest parameters that come in as String =
values and need to be bound to arbitrary properties of command objects. =
Multipart files on the other hand are by their very nature complex =
objects; they do not have a natural String representation.
=09
The previous mechanism of binding multipart files via PropertyEditor =
required MultipartHttpServletRequest's getParameter method to return the =
field name as value a la getParameter("myfield") -> "myfield", so that a =
PropertyEditor that can just see the value would be able to identify the =
field name and invoke MultipartHttpServletRequest's getFile("myfield") =
to return the MultipartFile instance. This *is* a workaround, as it is =
not at all natural to have getParameter return the field name as value =
in case of a multipart file.
=09
ServletRequestDataBinder is not a bad place for binding multipart =
files, given that our MultipartHttpServletRequest is a generic interface =
that resides in the non-DispatcherServlet-specific web.multipart package =
now. I agree that it isn't generally preferable to hardcode binding =
options, but I've initially felt that there aren't any other meaningful =
conversions than a MultipartFile itself or a byte[] as value of a =
command bean property. Note that you can always override =
BaseCommandController's onBindAndValidate to perform *custom* binding.
=09
-----
=09
On second thought, I agree that a pluggable conversion mechanism is =
preferable. I've just reworked the multipart binding into a =
PropertyEditor mechanism again, but with a different implementation =
pattern: ServletRequestDataBinder simply binds the file map returned by =
MultipartHttpServletRequest.getFileMap as property values. This means =
that bean properties of type MultipartFile can be populated directly, =
without conversion. Other types go through the PropertyEditor mechanism, =
but via calling setValue(Object) instead of setAsText(String).
=09
ByteArrayMultipartFileEditor and StringMultipartFileEditor implement =
setValue to transform the given MultipartFile instance into either a =
byte array or a String, the latter with configurable charset. Note than =
none of these needs a MultipartHttpServletRequest: They receive the =
MultipartFile instances bound as property values by =
ServletRequestDataBinder. Those two custom editors need to be registered =
with ServletRequestDataBinder via registerCustomEditor, preferably for =
specific fields to avoid conflicts with other fields of the type byte =
array or String.
=09
I consider this a good solution, more flexible than the hardcoded =
binding, but also cleaner than the PropertyEditor indirection with =
String parameters. Thanks for pointing at the issue again! Overriding =
PropertyEditor's setValue is generally a nice way to convert from =
non-String values to the required type; I didn't think of it at first, =
and I had to tweak BeanWrapperImpl a bit to allow for it. I hope you =
like the current solution too; does it fulfil your requirements now?
=09
Juergen
=09
=09
=09
-----Urspr ngliche Nachricht-----
Von: Trevor Cook [mailto:pr...@se...]
Gesendet: Mo 13.10.2003 22:22
An: jrgen h ller [werk3AT]; Spring Developers
Cc:
Betreff: RE: [Springframework-developer] Multipart File =
Handling
=20
=20
=09
<juergen>
Furthermore, I've dropped the previous PropertyEditors support, =
and the associated requirement for file parameters having to be =
available as normal parameters with the field name as value. That seemed =
like a workaround; instead, I've added explicit detection to =
ServletRequestDataBinder, which is now able to bind file parameters as =
MultipartFile or byte[], depending on the type of the target bean =
property. I've not reintroduced binding the original file name to a =
String property, as I can't see the value of that feature.
</juergen>
=20
No problem dropping the String <> filename, I wasn't sure if =
that would be useful or not.
=20
I do have a problem with dropping the PropertyEditors support, =
since in my mind it removes flexibility and consistency.
=20
Treating all the data (simple text fields or files) as =
parameters seems to make a lot more sense to me since you can then treat =
every piece of data the same (instead of having to handle parameters and =
files seperately). If the implementation was a little clumsy I =
apologize, but the concept was not a workaround but a goal to allow the =
user to be able to treat all data in the same manner.
=20
The issue of flexibility is due to the "explicit detection to =
ServletRequestDataBinder". In the previous implementation and the =
current one, files were automatically bound to an object based on the =
target properties type. The difference was that you could override it =
with a custom property editor (in the BaseCommandController initBinder =
method, for example). Under the current implementation, there is no way =
to override how the file is attached to the bean. Do you (or anybody =
else) have any suggestions on how to override the default Spring =
handling (currently hard-coded in ServletRequestDataBinder), or any =
ideas of how to change the implementation to allow this custom handling?
=20
Trevor D. Cook
=20
=20
=09
=
N=18HYXu=16w=1A+m>xZ=1AzMx'=17z{=08=1CB=105z??')rH?q=07z??J=07jgzx?G?q=07=
z?X?~zwX??=07jgz=20
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 09/10/2003
|
|
From: <jue...@we...> - 2003-10-14 13:15:55
|
VGhlIHNlcGFyYXRpbmcgbGluZSBpbiBteSBvcmlnaW5hbCBtYWlsIGFjdHVhbGx5IG1lYW5zIGFi b3V0IDIgaG91cnMgaW5iZXR3ZWVuLi4uIGVub3VnaCB0aW1lIHRvIGRvIGludGVuc2UgY29kZSBj aGVja3MgYW5kIHNvbWUgc2VyaW91cyByZWNvbnNpZGVyYXRpb24uIEkgc3RpbGwgaGF2ZSB0byBz bWlsZSBteXNlbGYgd2hlbiBJIGxvb2sgYXQgdGhhdCBhZ2FpbiA7LSkNCg0KVGhlIGFyZ3VtZW50 cyBkaWRuJ3QgZmxpcCBjb21wbGV0ZWx5IEJUVywganVzdCBpbiB0ZXJtcyBvZiBkaXNtaXNzaW5n IFByb3BlcnR5RWRpdG9yIGFzIGEgd2hvbGU6IFdlIGRvbid0IHVzZSBpbnRlcm1lZGlhdGUgU3Ry aW5nIHJlcHJlc2VudGF0aW9ucyB2aWEgcmVxdWVzdC5nZXRQYXJhbWV0ZXIgYW55bW9yZSwgd2hp Y2ggd2FzIG15IG1haW4gaW50ZW50Lg0KDQpJJ20gZ2xhZCB0aGF0IHlvdSdyZSBoYXBweSB3aXRo IGl0IG5vdy4gSSdtIHRvbywgYWN0dWFsbHkhIFRoYXQncyB0aGUgZ3JlYXQgdGhpbmcgYWJvdXQg d29ya2luZyBpbiBhIHRlYW0sIGV2ZW4gaWYgImp1c3QiIGEgZGlzdHJpYnV0ZWQgb25lOiBNdWx0 aXBsZSBwb2ludHMgb2YgdmlldyBjYW4gY3JlYXRlIG11Y2ggYmV0dGVyIHNvbHV0aW9ucyB0aGFu IGEgc2luZ2xlIG1pbmQgZXZlciBjb3VsZC4NCg0KSnVzdCBvdXQgb2YgY3VyaW9zaXR5OiBXaGF0 IGFkZGl0aW9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dGhlIEJhc2VDb21tYW5kQ29udHJvbGxlciBp bml0QmluZGVyIG1ldGhvZCwgZm9yIGV4YW1wbGUpLiAgVW5kZXIgdGhlIGN1cnJlbnQgaW1wbGVt ZW50YXRpb24sIHRoZXJlIGlzIG5vIHdheSB0byBvdmVycmlkZSBob3cgdGhlIGZpbGUgaXMgYXR0 YWNoZWQgdG8gdGhlIGJlYW4uICBEbyB5b3UgKG9yIGFueWJvZHkgZWxzZSkgaGF2ZSBhbnkgc3Vn Z2VzdGlvbnMgb24gaG93IHRvIG92ZXJyaWRlIHRoZSBkZWZhdWx0IFNwcmluZyBoYW5kbGluZyAo Y3VycmVudGx5IGhhcmQtY29kZWQgaW4gU2VydmxldFJlcXVlc3REYXRhQmluZGVyKSwgb3IgYW55 IGlkZWFzIG9mIGhvdyB0byBjaGFuZ2UgdGhlIGltcGxlbWVudGF0aW9uIHRvIGFsbG93IHRoaXMg Y3VzdG9tIGhhbmRsaW5nPw0KCSAgICAgICANCgkgICAgICAgIFRyZXZvciBELiBDb29rDQoJICAg ICAgIA0KCSAgICAgICANCgkNCglOGEhZWHUWdxorbT54Whp6TXgnF3p7CBxCEDV6Pz8nKXJIP3EH ej8/SgdqZ3p4P0c/cQd6P1g/fnp3WD8/B2pneiANCg0KDQotLS0NCkluY29taW5nIG1haWwgaXMg Y2VydGlmaWVkIFZpcnVzIEZyZWUuDQpDaGVja2VkIGJ5IEFWRyBhbnRpLXZpcnVzIHN5c3RlbSAo aHR0cDovL3d3dy5ncmlzb2Z0LmNvbSkuDQpWZXJzaW9uOiA2LjAuNTI1IC8gVmlydXMgRGF0YWJh c2U6IDMyMiAtIFJlbGVhc2UgRGF0ZTogMDkvMTAvMjAwMw0KDQo= |
|
From: Trevor C. <pr...@se...> - 2003-10-14 13:06:09
|
It is interesting seeing your arguments flip 180 degrees in a few =
paragraphs, but you're not alone there. I find the same thing, that =
talking helps me find my own solutions.
As far as the implementation goes, the changes are perfect. It's a lot =
cleaner than my original version (no coupling with DispatcherServlet or =
property editors), but we still have the benefit of custom property =
handling.
I've migrated our project from the original multipart to the new =
version, and everything works great. My code uses "standard" handling =
(byte[] and MultipartFile) as well as the custom property editors. I've =
also subclassed the CommonsMultipartResolver to provide some additional =
functionality in our app, and that works perfect as well.
I think we have a winner :)
Trevor D. Cook
-----Original Message-----
From: j=C3=BCrgen h=C3=B6ller [werk3AT] =
[mailto:jue...@we...]
Sent: October 14, 2003 1:13 AM
To: j=C3=BCrgen h=C3=B6ller [werk3AT]; Trevor Cook; Spring Developers
Subject: Re: [Springframework-developer] Multipart File Handling
P.S.: Funny how the direction of an own argument can change in the =
course of a single email ;-) Of course, I was talking about =
PropertyEditor's setAsText (and the indirection with String values that =
match field names) in the first paragraph, and haven't had realized at =
that time that there was the completely different setValue option too...
=20
Juergen
=20
-----Ursprngliche Nachricht-----=20
Von: j rgen hller [werk3AT]=20
Gesendet: Di 14.10.2003 01:26=20
An: Trevor Cook; Spring Developers=20
Cc:=20
Betreff: Re: [Springframework-developer] Multipart File Handling
=09
=09
Trevor,
=09
Sorry if I've been a bit eager in terms of getting rid of the =
PropertyEditor stuff for multipart files. I strongly believe that the =
JavaBeans PropertyEditor is not appropriate for multipart files though, =
as it is about converting *String* parameters to other types. This is =
fine for standard ServletRequest parameters that come in as String =
values and need to be bound to arbitrary properties of command objects. =
Multipart files on the other hand are by their very nature complex =
objects; they do not have a natural String representation.
=09
The previous mechanism of binding multipart files via PropertyEditor =
required MultipartHttpServletRequest's getParameter method to return the =
field name as value a la getParameter("myfield") -> "myfield", so that a =
PropertyEditor that can just see the value would be able to identify the =
field name and invoke MultipartHttpServletRequest's getFile("myfield") =
to return the MultipartFile instance. This *is* a workaround, as it is =
not at all natural to have getParameter return the field name as value =
in case of a multipart file.
=09
ServletRequestDataBinder is not a bad place for binding multipart =
files, given that our MultipartHttpServletRequest is a generic interface =
that resides in the non-DispatcherServlet-specific web.multipart package =
now. I agree that it isn't generally preferable to hardcode binding =
options, but I've initially felt that there aren't any other meaningful =
conversions than a MultipartFile itself or a byte[] as value of a =
command bean property. Note that you can always override =
BaseCommandController's onBindAndValidate to perform *custom* binding.
=09
-----
=09
On second thought, I agree that a pluggable conversion mechanism is =
preferable. I've just reworked the multipart binding into a =
PropertyEditor mechanism again, but with a different implementation =
pattern: ServletRequestDataBinder simply binds the file map returned by =
MultipartHttpServletRequest.getFileMap as property values. This means =
that bean properties of type MultipartFile can be populated directly, =
without conversion. Other types go through the PropertyEditor mechanism, =
but via calling setValue(Object) instead of setAsText(String).
=09
ByteArrayMultipartFileEditor and StringMultipartFileEditor implement =
setValue to transform the given MultipartFile instance into either a =
byte array or a String, the latter with configurable charset. Note than =
none of these needs a MultipartHttpServletRequest: They receive the =
MultipartFile instances bound as property values by =
ServletRequestDataBinder. Those two custom editors need to be registered =
with ServletRequestDataBinder via registerCustomEditor, preferably for =
specific fields to avoid conflicts with other fields of the type byte =
array or String.
=09
I consider this a good solution, more flexible than the hardcoded =
binding, but also cleaner than the PropertyEditor indirection with =
String parameters. Thanks for pointing at the issue again! Overriding =
PropertyEditor's setValue is generally a nice way to convert from =
non-String values to the required type; I didn't think of it at first, =
and I had to tweak BeanWrapperImpl a bit to allow for it. I hope you =
like the current solution too; does it fulfil your requirements now?
=09
Juergen
=09
=09
=09
-----Urspr ngliche Nachricht-----
Von: Trevor Cook [mailto:pr...@se...]
Gesendet: Mo 13.10.2003 22:22
An: jrgen h ller [werk3AT]; Spring Developers
Cc:
Betreff: RE: [Springframework-developer] Multipart File =
Handling
=20
=20
=09
<juergen>
Furthermore, I've dropped the previous PropertyEditors support, =
and the associated requirement for file parameters having to be =
available as normal parameters with the field name as value. That seemed =
like a workaround; instead, I've added explicit detection to =
ServletRequestDataBinder, which is now able to bind file parameters as =
MultipartFile or byte[], depending on the type of the target bean =
property. I've not reintroduced binding the original file name to a =
String property, as I can't see the value of that feature.
</juergen>
=20
No problem dropping the String <> filename, I wasn't sure if =
that would be useful or not.
=20
I do have a problem with dropping the PropertyEditors support, =
since in my mind it removes flexibility and consistency.
=20
Treating all the data (simple text fields or files) as =
parameters seems to make a lot more sense to me since you can then treat =
every piece of data the same (instead of having to handle parameters and =
files seperately). If the implementation was a little clumsy I =
apologize, but the concept was not a workaround but a goal to allow the =
user to be able to treat all data in the same manner.
=20
The issue of flexibility is due to the "explicit detection to =
ServletRequestDataBinder". In the previous implementation and the =
current one, files were automatically bound to an object based on the =
target properties type. The difference was that you could override it =
with a custom property editor (in the BaseCommandController initBinder =
method, for example). Under the current implementation, there is no way =
to override how the file is attached to the bean. Do you (or anybody =
else) have any suggestions on how to override the default Spring =
handling (currently hard-coded in ServletRequestDataBinder), or any =
ideas of how to change the implementation to allow this custom handling?
=20
Trevor D. Cook
=20
=20
=09
=
N=18HYXu=16w=1A+m>xZ=1AzMx'=17z{=08=1CB=105z??')rH?q=07z??J=07jgzx?G?q=07=
z?X?~zwX??=07jgz=20
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 09/10/2003
|