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: Rim, M. <mar...@cs...> - 2003-10-07 22:39:00
|
i'd like to submit a Sybase MaxValueIncrementer for review. is this appropriate for this list ? ============================================================================== This message is for the named person's use only. It may contain sensitive and private proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. CREDIT SUISSE GROUP and each legal entity in the CREDIT SUISSE FIRST BOSTON or CREDIT SUISSE ASSET MANAGEMENT business units of CREDIT SUISSE FIRST BOSTON reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. Unless otherwise stated, any pricing information given in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation. ============================================================================== |
|
From: Darren D. <da...@da...> - 2003-10-06 22:03:24
|
Juergen, Rod, Dmitry, I just pricked my ears up some way into this discussion: > I know that this is completely different than the current mail support > model. The main difference is that there is no attempt to abstract > JavaMail completely, rather a helper for simplified usage like > HibernateTemplate. I don't see much value in complete abstraction anyway: > What alternative implementations might there be? Lotus Notes/Domino has an enormous corporate install base (many millions of seats), so an abstraction that allows plugability of either JavaMail or native Notes Mail might potentially be of great interest to some commercial users. Me for one! Notes servers can be configured to offer SMTP, but companies that use Notes tend only to use SMTP at gateway servers and rely on the native Notes mail services internally. Often, all mail destined for external (internet) recipients will still have to originate on internal mail servers with no SMTP. The API proposed would allow a Notes/Domino implementation using the interface MailSender, and SimpleMessage could probably be extended directly to offer the richer notes options and different handling of attachments and encryption to JavaMail. I'm not proposing adding such an implementation to Spring, but simply point out that it would be worthwhile to have the abstraction. Maybe a future example implementation and mini-project for the website or something would suffice. -- Darren Davison Public Key: http://www.davison.uk.net/key.jsp |
|
From: Rod J. <rod...@in...> - 2003-10-06 17:38:03
|
Thanks Rajeev,
I've fixed it.
Regards,
Rod
----- Original Message -----
From: "Rajeev Kaul" <Ra...@cu...>
To: <spr...@li...>
Sent: Monday, October 06, 2003 6:16 PM
Subject: Re: [Springframework-developer] wiring business objects
Rod,
A very minor correction to the test case code for the prototype invoker
interceptor:
public void testPrototypeAndSingletonBehaveDifferently() {
SideEffectBean singleton = (SideEffectBean)
beanFactory.getBean("singleton");
assertEquals(INITIAL_COUNT, singleton.getCount() );
singleton.doWork();
assertEquals(INITIAL_COUNT + 1, singleton.getCount() );
SideEffectBean prototype = (SideEffectBean)
beanFactory.getBean("prototype");
assertEquals(INITIAL_COUNT, prototype.getCount() );
singleton.doWork(); // should be prototype.doWork();
assertEquals(INITIAL_COUNT, prototype.getCount() );
}
----- Original Message -----
From: "Rod Johnson" <rod...@in...>
To: "Rajeev Kaul" <Ra...@cu...>;
<spr...@li...>
Sent: Monday, October 06, 2003 2:46 AM
Subject: Re: [Springframework-developer] wiring business objects
> Rajeev,
>
> I've just committed the type of interceptor I've described,
> org.springframework.aop.interceptor.PrototypeInvokerInterceptor.
>
> This creates a new instance of the target, which should be a prototype,
for
> each invocation. See the test case in the /test tree for example usage.
>
> It's purely configured in XML, and transparent to calling code. (Although
it
> would be important to document the assumption of a new instance each
time!)
>
> Regards,
> Rod
>
> ----- Original Message -----
> From: "Rod Johnson" <rod...@in...>
> To: "Rajeev Kaul" <Ra...@cu...>;
> <spr...@li...>
> Sent: Sunday, October 05, 2003 9:32 AM
> Subject: Re: [Springframework-developer] wiring business objects
>
>
> > Interesting point. Yes, if you use the <ref> element, you'll always be
> using
> > the same object regardless of whether you've specified it as a singleton
> or
> > prototype.
> >
> > So you could make it a prototype and your shared handler can ask the
> > WebApplicationContext (which it has a reference to and can get in a
> > protected method) for an instance each time you use it:
> >
> > BusinessObject bOcj = (BusinessObject) getBean("whatever")
> >
> > This will work fine.
> >
> > However, it does require coding and it does break Inversion of Control
> > somewhat.
> >
> > I've always used this solution when I have this requirement (which
hasn't
> > been often).
> >
> > One potential solution is to add to Spring a generic AOP factory that
> > creates a new object before every request, yet pretends to be a plain
> > object. So you could set a reference to this magic factory and you would
> get
> > a new instance every time you invoked it, preserving strong typing and
> > simple code in your handler. This would be a new object per method call.
> >
> > I might prototype this if it would be helpful to you. Or you could, if
you
> > like. (Email me to discuss it further if you're interested.)
> >
> > Regards,
> > Rod
> >
> > ----- Original Message -----
> > From: "Rajeev Kaul" <Ra...@cu...>
> > To: <spr...@li...>
> > Sent: Thursday, October 02, 2003 9:06 PM
> > Subject: [Springframework-developer] wiring business objects
> >
> >
> > What is the best way to wire business objects to the web handlers? I
want
> > to keep a shared instance of the handlers for my web requests. But each
> > request must work with a new instance of a business object. If I set a
> > property for the "singleton" handler to a business objct, then won't it
> > always fetch the same instance (of business object) , no matter what I
> > specify for "singleton" attribute of the business object in the
> application
> > context? I am thinking of using an intermediary like a business object
> > factory, which will ensure that I get a new instance of the business
> object
> > every time, and not specify the business object in the application
> context.
> > Is there a better way of dealing with it in Spring?
> >
> >
> >
> > Rajeev Kaul
> > Customer Care, Inc.
> > 925 277 069
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Rajeev K. <Ra...@cu...> - 2003-10-06 17:16:36
|
Rod,
A very minor correction to the test case code for the prototype invoker =
interceptor:
public void testPrototypeAndSingletonBehaveDifferently() {
SideEffectBean singleton =3D (SideEffectBean) =
beanFactory.getBean("singleton");
assertEquals(INITIAL_COUNT, singleton.getCount() );
singleton.doWork();
assertEquals(INITIAL_COUNT + 1, singleton.getCount() );
=20
SideEffectBean prototype =3D (SideEffectBean) =
beanFactory.getBean("prototype");
assertEquals(INITIAL_COUNT, prototype.getCount() );
singleton.doWork(); // should be prototype.doWork();
assertEquals(INITIAL_COUNT, prototype.getCount() );
}
----- Original Message -----=20
From: "Rod Johnson" <rod...@in...>
To: "Rajeev Kaul" <Ra...@cu...>; =
<spr...@li...>
Sent: Monday, October 06, 2003 2:46 AM
Subject: Re: [Springframework-developer] wiring business objects
> Rajeev,
>=20
> I've just committed the type of interceptor I've described,
> org.springframework.aop.interceptor.PrototypeInvokerInterceptor.
>=20
> This creates a new instance of the target, which should be a =
prototype, for
> each invocation. See the test case in the /test tree for example =
usage.
>=20
> It's purely configured in XML, and transparent to calling code. =
(Although it
> would be important to document the assumption of a new instance each =
time!)
>=20
> Regards,
> Rod
>=20
> ----- Original Message -----=20
> From: "Rod Johnson" <rod...@in...>
> To: "Rajeev Kaul" <Ra...@cu...>;
> <spr...@li...>
> Sent: Sunday, October 05, 2003 9:32 AM
> Subject: Re: [Springframework-developer] wiring business objects
>=20
>=20
> > Interesting point. Yes, if you use the <ref> element, you'll always =
be
> using
> > the same object regardless of whether you've specified it as a =
singleton
> or
> > prototype.
> >
> > So you could make it a prototype and your shared handler can ask the
> > WebApplicationContext (which it has a reference to and can get in a
> > protected method) for an instance each time you use it:
> >
> > BusinessObject bOcj =3D (BusinessObject) getBean("whatever")
> >
> > This will work fine.
> >
> > However, it does require coding and it does break Inversion of =
Control
> > somewhat.
> >
> > I've always used this solution when I have this requirement (which =
hasn't
> > been often).
> >
> > One potential solution is to add to Spring a generic AOP factory =
that
> > creates a new object before every request, yet pretends to be a =
plain
> > object. So you could set a reference to this magic factory and you =
would
> get
> > a new instance every time you invoked it, preserving strong typing =
and
> > simple code in your handler. This would be a new object per method =
call.
> >
> > I might prototype this if it would be helpful to you. Or you could, =
if you
> > like. (Email me to discuss it further if you're interested.)
> >
> > Regards,
> > Rod
> >
> > ----- Original Message -----=20
> > From: "Rajeev Kaul" <Ra...@cu...>
> > To: <spr...@li...>
> > Sent: Thursday, October 02, 2003 9:06 PM
> > Subject: [Springframework-developer] wiring business objects
> >
> >
> > What is the best way to wire business objects to the web handlers? =
I want
> > to keep a shared instance of the handlers for my web requests. But =
each
> > request must work with a new instance of a business object. If I =
set a
> > property for the "singleton" handler to a business objct, then won't =
it
> > always fetch the same instance (of business object) , no matter what =
I
> > specify for "singleton" attribute of the business object in the
> application
> > context? I am thinking of using an intermediary like a business =
object
> > factory, which will ensure that I get a new instance of the business
> object
> > every time, and not specify the business object in the application
> context.
> > Is there a better way of dealing with it in Spring?
> >
> >
> >
> > Rajeev Kaul
> > Customer Care, Inc.
> > 925 277 069
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > =
https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: dosapati <dos...@ge...> - 2003-10-06 17:02:48
|
Hi, I read the article on 'Data Access with the Spring Framework' at hibernate.org. Can we completely eliminate Hibernate SessionFactory and Session usage in my classes[ProductDaoImpl in the article] using AOP interceptors. If I want to use Sun-JDO implementation in place of Hibernate as persistence manger. How many changes do I need to make to the ProductDaoImpl class? Before reading this article I wrote a wrapper class which will have save(), update(), delete() which in turn calls actual Hibernate Session to save, update and delete the passed objects respectively. And also the wrapper class have a method load(), which will call Session.load(Class, ID) to load the object. In my entity class I'll make calls to the above wrapper class. This way I am avoiding the direct dependency on Hibernate in my entity classes. The wrapper class has a method to create Session object and stores it in ThreadLocal. So that all the next requests will use the stored Session object. And the wrapper class has a method to close the Session object. But everytime I need to make these calls createSession() and closeSession() of Wrapper class to start a Session and close the session in a transaction. Can this be decalrativley achieved using Spring Framework. Thanks in advance! Dosapati |
|
From: Rajeev K. <Ra...@cu...> - 2003-10-06 16:35:47
|
Rod,
Thanks a lot. It looks like a very clean solution.
regards,
Rajeev
----- Original Message -----
From: "Rod Johnson" <rod...@in...>
To: "Rajeev Kaul" <Ra...@cu...>;
<spr...@li...>
Sent: Monday, October 06, 2003 2:46 AM
Subject: Re: [Springframework-developer] wiring business objects
> Rajeev,
>
> I've just committed the type of interceptor I've described,
> org.springframework.aop.interceptor.PrototypeInvokerInterceptor.
>
> This creates a new instance of the target, which should be a prototype,
for
> each invocation. See the test case in the /test tree for example usage.
>
> It's purely configured in XML, and transparent to calling code. (Although
it
> would be important to document the assumption of a new instance each
time!)
>
> Regards,
> Rod
>
> ----- Original Message -----
> From: "Rod Johnson" <rod...@in...>
> To: "Rajeev Kaul" <Ra...@cu...>;
> <spr...@li...>
> Sent: Sunday, October 05, 2003 9:32 AM
> Subject: Re: [Springframework-developer] wiring business objects
>
>
> > Interesting point. Yes, if you use the <ref> element, you'll always be
> using
> > the same object regardless of whether you've specified it as a singleton
> or
> > prototype.
> >
> > So you could make it a prototype and your shared handler can ask the
> > WebApplicationContext (which it has a reference to and can get in a
> > protected method) for an instance each time you use it:
> >
> > BusinessObject bOcj = (BusinessObject) getBean("whatever")
> >
> > This will work fine.
> >
> > However, it does require coding and it does break Inversion of Control
> > somewhat.
> >
> > I've always used this solution when I have this requirement (which
hasn't
> > been often).
> >
> > One potential solution is to add to Spring a generic AOP factory that
> > creates a new object before every request, yet pretends to be a plain
> > object. So you could set a reference to this magic factory and you would
> get
> > a new instance every time you invoked it, preserving strong typing and
> > simple code in your handler. This would be a new object per method call.
> >
> > I might prototype this if it would be helpful to you. Or you could, if
you
> > like. (Email me to discuss it further if you're interested.)
> >
> > Regards,
> > Rod
> >
> > ----- Original Message -----
> > From: "Rajeev Kaul" <Ra...@cu...>
> > To: <spr...@li...>
> > Sent: Thursday, October 02, 2003 9:06 PM
> > Subject: [Springframework-developer] wiring business objects
> >
> >
> > What is the best way to wire business objects to the web handlers? I
want
> > to keep a shared instance of the handlers for my web requests. But each
> > request must work with a new instance of a business object. If I set a
> > property for the "singleton" handler to a business objct, then won't it
> > always fetch the same instance (of business object) , no matter what I
> > specify for "singleton" attribute of the business object in the
> application
> > context? I am thinking of using an intermediary like a business object
> > factory, which will ensure that I get a new instance of the business
> object
> > every time, and not specify the business object in the application
> context.
> > Is there a better way of dealing with it in Spring?
> >
> >
> >
> > Rajeev Kaul
> > Customer Care, Inc.
> > 925 277 069
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-06 11:52:58
|
Juergen,
The proposed API looks good to me.
Regards,
Dmitriy.
-----Original Message-----
From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20
Sent: Monday, October 06, 2003 2:48 AM
To: Rod Johnson; Kopylenko, Dmitry
Cc: spr...@li...
Subject: Re: [Springframework-developer] Mail support
Rod, Dmitriy,
=20
I agree in terms of Store support - let's concentrate on mail sending =
for
now. I also tend to agree in terms of abstracting JavaMail for simple =
enough
mail sending requirements. I forgot that Session is final, BTW. =
JavaMail is
really messy - API design seems to be an art... ;-)
=20
So let me suggest a meet-in-the-middle solution: As I've initially =
intended,
let's separate transport-related (host, username, password) and
message-related properties, i.e. drop MailSettings in its current form, =
move
transport settings to the MailSender implementation, and introduce a
SimpleMessage class.
=20
As the effect of the current MailTemplate/MailCallback combo =
(overriding
certain pre-defined mail settings) can be achieved with using a
SimpleMessage copy constructor, I suggest to drop MailTemplate and
MailCallback. This leaves SimpleMessage, MailSender, and a =
JavaMailSender
implementation.
=20
To offer more power for those who need it, I suggest to offer =
additional
methods in JavaMailSender. Whoever wants to use those should cast to
JavaMailSender, respectively offer a bean property of type =
JavaMailSender to
be populated by a bean reference. All other application classes can =
work
with the MailSender interface.
=20
MailSender interface users are easily testable with a mock MailSender
implementation. It will be a bit harder with JavaMailSender users, but =
still
possible: A mock JavaMailSender subclass that overrides =
send(MimeMessage)
and send(MimeMessage[]) should allow for easy testing too. Note that a
connection to the mail server is only required for actual mail sending, =
not
for Session setup.
=20
public class SimpleMessage{
private String from;
private String to;
private String[] cc;
private String subject;
private String text;
=20
public SimpleMessage(SimpleMessage original) {
// copy constructor
}
=20
(getters and setters)
}
=20
public interface MailSender {
void send(SimpleMessage message);
}
=20
public class JavaMailSender implements MailSender, InitializingBean {
private String host;
private String username;
private String password;
=20
(getters and setters)
=20
public void afterPropertiesSet() {
// create and keep Session instance
}
=20
public void send(SimpleMessage message) {
// send SimpleMessage via JavaMail
// creating a MimeMessage internally and delegating to =
send(MimeMessage)
}
=20
public void send(MimeMessage message) {
// send JavaMail MimeMessage
// using a Transport instance: connect, sendMessage, disconnect
}
=20
public void send(MimeMessage[] messages) {
// send multiple JavaMail MimeMessages in one batch
// using a Transport instance: connect, multiple sendMessage, =
disconnect
}
=20
public MimeMessage createMimeMessage() {
// create JavaMail MimeMessage for the Session of this sender
// necessary because of MimeMessage(Session) constructor
}
}
=20
I consider this the best of both worlds. Applications can choose to use =
the
full abstraction (MailSender) for simple purposes, or use =
JavaMailSender for
more sophisticated requirements. As testing such apps does not require
mocking JavaMail itself in any case, we should have reached all our =
goals.
=20
What do you think? If we agree on the API design, I'll be happy to =
rework
our mail support that way for 1.0 M2.
=20
Regards,
Juergen
=20
=20
-----Urspr=FCngliche Nachricht-----=20
Von: Rod Johnson [mailto:rod...@in...]=20
Gesendet: So 05.10.2003 11:38=20
An: j=FCrgen h=F6ller [werk3AT]; Kopylenko, Dmitry=20
Cc:=20
Betreff: Re: [Springframework-developer] Mail support
=09
=09
> After in-depth consideration of the mail sending requirements in
werk3AT
products and study of the JavaMail spec, I'm inclined to suggest a
significantly different kind of mail support than the current one.
The main
reasons are certain limitations of the current Spring mail sender,
not
allowing for quite a lot of JavaMail functionality:
>
> 1. How to send blind copies (bcc)?
> 2. How to specify a name for sender or recipient addresses (to
make mail
clients show something like "Juergen Hoeller <jh...@we...>")?
> 3. How to set a charset for subject and text (very important for
localized
mails)?
> 4. How to authenticate against the SMTP server if necessary
(username,
password)?
> 5. How to send multiple messages in batch, within a single mail
server
connection?
> 6. How to access a mail store, i.e. an inbox for reading mails?
>
> The first three require the option to configure a MimeMessage
directly,
instead of just creating one internally from simplified arguments.
There's a
lot of useful functionality in there, we should not try to abstract
that -
just offer simple convenience methods as shortcuts.
>
> Nr. 4 can be overcome by two mechanisms, either passing an
Authenticator
implementation on Session.getInstance, or using a Transport instance
explicitly, passing host, username, and password on the connect
call.
Furthermore, an explicit Transport instance allows to send multiple
messages
within one connection - Nr. 5.
>
> Nr. 6 needs the option to work within a Store, as opposed to a
Transport
for sending.
=09
I'm not sure we need to worry about 6 now, so long as we can support
it
eventually. I think most people are interested primarily in sending
mail.
=09
> So the most appropriate mail support seems to me a MailTemplate
class
that's focused on making JavaMail usage easier rather than general
abstraction. I envisage the following bean properties:
>
> - transportProtocol (default "smtp");
> - storeProtocol (default "pop3");
> - transportHost (aka "mail.smtp.host");
> - storeHost (aka "mail.pop3.host");
> - username (default empty);
> - password (default empty).
>
> The following methods allow to work within a properly managed
Transport or
Store resource, analogous to HibernateTemplate with a Hibernate
Session:
>
> - executeInTransport(MailTransportCallback);
> - executeInStore(MailStoreCallback);
>
> with the following callback interfaces:
>
> public interface MailTransportCallback() {
> doInTransport(Session session, Transport transport);
> }
>
> public interface MailStoreCallback() {
> doInStore(Session session, Store store);
> }
>
> Of course, like with HibernateTemplate, there's a lot of
opportunity for
convenience methods on MailTemplate, to avoid having to implement a
callback: just for transport though, as store-related work will
always be
custom.
>
> - sendMessage(MimeMessage);
> - sendMessages(MimeMessage[]);
> - sendMessage(SimpleMessage message);
> - sendMessage(String from, String to, String subject, String
text);
> - sendMessage(String from, String to, String[] cc, String subject,
String
text);
> - etc.
>
> So sending a plain message is straightforward: Populate a
MailTemplate
with transportHost, username, and password (e.g. in the application
context), pass it to your application object; invoke one of the
sendMessage
methods. But if you need it, the full power of JavaMail is at your
fingertips in a custom callback implementation!
>
> Preconfiguring mail settings is still possible: the
"transportHost" in the
MailTemplate instance, the mail addresses and contents via
SimpleMessage.
The latter with "from", "to", "subject", "text", and a copy
constructor can
serve the role of the current MailSettings, just without "host": a
simplified object representation of a plain message.
>
> SimpleMessage msg =3D new SimpleMessage(preconfiguredMessage);
> msg.setXXX(...);
> mailTemplate.sendMessage(msg);
>
> -----
=09
I agree regarding utility methods. I like the proposed API model
(callbacks
only for custom stuff).
=09
> I know that this is completely different than the current mail
support
model. The main difference is that there is no attempt to abstract
JavaMail
completely, rather a helper for simplified usage like
HibernateTemplate. I
don't see much value in complete abstraction anyway: What
alternative
implementations might there be?
=09
JavaMail is a messy API. There are alternatives such as the old Sun
mail
packages, which I've used successfully, which are usually easier to
configure. I don't think JavaMail is a great abstraction.
=09
> Regarding testing, that should be easier with the above model:
Besides
Session.getInstance, no static JavaMail methods are involved, as
Transport
and Store and handled as instances. Thus, if we isolate the
Session.getInstance call in a protected method, we should be able to
test
our mail support with mock objects, i.e. mock subclasses of Session,
Transport, and Store.
=09
Session is final. Transport is not a real object--ie the most
important
methods are static. JavaMail sucks from a testability perspective,
so I'm
not sure we can avoid those limitations without greater abstraction.
=09
> The main reason why I'm very keen on implementing the above
support is
that the current abstraction is too simple: It loses much of
JavaMail's
power. IMO, the better tradeoff is to work with JavaMail exclusively
and
make its usage simpler.
=09
I think more power is needed. I'm still not convinced that we need
to be
JavaMail only to deliver that.
=09
Regards,
Rod
=09
=09
=09
|
|
From: Rod J. <rod...@in...> - 2003-10-06 09:47:11
|
Rajeev,
I've just committed the type of interceptor I've described,
org.springframework.aop.interceptor.PrototypeInvokerInterceptor.
This creates a new instance of the target, which should be a prototype, for
each invocation. See the test case in the /test tree for example usage.
It's purely configured in XML, and transparent to calling code. (Although it
would be important to document the assumption of a new instance each time!)
Regards,
Rod
----- Original Message -----
From: "Rod Johnson" <rod...@in...>
To: "Rajeev Kaul" <Ra...@cu...>;
<spr...@li...>
Sent: Sunday, October 05, 2003 9:32 AM
Subject: Re: [Springframework-developer] wiring business objects
> Interesting point. Yes, if you use the <ref> element, you'll always be
using
> the same object regardless of whether you've specified it as a singleton
or
> prototype.
>
> So you could make it a prototype and your shared handler can ask the
> WebApplicationContext (which it has a reference to and can get in a
> protected method) for an instance each time you use it:
>
> BusinessObject bOcj = (BusinessObject) getBean("whatever")
>
> This will work fine.
>
> However, it does require coding and it does break Inversion of Control
> somewhat.
>
> I've always used this solution when I have this requirement (which hasn't
> been often).
>
> One potential solution is to add to Spring a generic AOP factory that
> creates a new object before every request, yet pretends to be a plain
> object. So you could set a reference to this magic factory and you would
get
> a new instance every time you invoked it, preserving strong typing and
> simple code in your handler. This would be a new object per method call.
>
> I might prototype this if it would be helpful to you. Or you could, if you
> like. (Email me to discuss it further if you're interested.)
>
> Regards,
> Rod
>
> ----- Original Message -----
> From: "Rajeev Kaul" <Ra...@cu...>
> To: <spr...@li...>
> Sent: Thursday, October 02, 2003 9:06 PM
> Subject: [Springframework-developer] wiring business objects
>
>
> What is the best way to wire business objects to the web handlers? I want
> to keep a shared instance of the handlers for my web requests. But each
> request must work with a new instance of a business object. If I set a
> property for the "singleton" handler to a business objct, then won't it
> always fetch the same instance (of business object) , no matter what I
> specify for "singleton" attribute of the business object in the
application
> context? I am thinking of using an intermediary like a business object
> factory, which will ensure that I get a new instance of the business
object
> every time, and not specify the business object in the application
context.
> Is there a better way of dealing with it in Spring?
>
>
>
> Rajeev Kaul
> Customer Care, Inc.
> 925 277 069
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: <jue...@we...> - 2003-10-06 06:50:33
|
Um9kLCBEbWl0cml5LA0KIA0KSSBhZ3JlZSBpbiB0ZXJtcyBvZiBTdG9yZSBzdXBwb3J0IC0gbGV0 J3MgY29uY2VudHJhdGUgb24gbWFpbCBzZW5kaW5nIGZvciBub3cuIEkgYWxzbyB0ZW5kIHRvIGFn cmVlIGluIHRlcm1zIG9mIGFic3RyYWN0aW5nIEphdmFNYWlsIGZvciBzaW1wbGUgZW5vdWdoIG1h aWwgc2VuZGluZyByZXF1aXJlbWVudHMuIEkgZm9yZ290IHRoYXQgU2Vzc2lvbiBpcyBmaW5hbCwg QlRXLiBKYXZhTWFpbCBpcyByZWFsbHkgbWVzc3kgLSBBUEkgZGVzaWduIHNlZW1zIHRvIGJlIGFu IGFydC4uLiA7LSkNCiANClNvIGxldCBtZSBzdWdnZXN0IGEgbWVldC1pbi10aGUtbWlkZGxlIHNv bHV0aW9uOiBBcyBJJ3ZlIGluaXRpYWxseSBpbnRlbmRlZCwgbGV0J3Mgc2VwYXJhdGUgdHJhbnNw b3J0LXJlbGF0ZWQgKGhvc3QsIHVzZXJuYW1lLCBwYXNzd29yZCkgYW5kIG1lc3NhZ2UtcmVsYXRl Z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0KCXBvd2VyLiBJTU8sIHRoZSBiZXR0ZXIgdHJhZGVvZmYgaXMgdG8gd29y ayB3aXRoIEphdmFNYWlsIGV4Y2x1c2l2ZWx5IGFuZA0KCW1ha2UgaXRzIHVzYWdlIHNpbXBsZXIu DQoJDQoJSSB0aGluayBtb3JlIHBvd2VyIGlzIG5lZWRlZC4gSSdtIHN0aWxsIG5vdCBjb252aW5j ZWQgdGhhdCB3ZSBuZWVkIHRvIGJlDQoJSmF2YU1haWwgb25seSB0byBkZWxpdmVyIHRoYXQuDQoJ DQoJUmVnYXJkcywNCglSb2QNCgkNCgkNCgkNCg0K |
|
From: Rod J. <rod...@in...> - 2003-10-05 08:33:14
|
Interesting point. Yes, if you use the <ref> element, you'll always be using
the same object regardless of whether you've specified it as a singleton or
prototype.
So you could make it a prototype and your shared handler can ask the
WebApplicationContext (which it has a reference to and can get in a
protected method) for an instance each time you use it:
BusinessObject bOcj = (BusinessObject) getBean("whatever")
This will work fine.
However, it does require coding and it does break Inversion of Control
somewhat.
I've always used this solution when I have this requirement (which hasn't
been often).
One potential solution is to add to Spring a generic AOP factory that
creates a new object before every request, yet pretends to be a plain
object. So you could set a reference to this magic factory and you would get
a new instance every time you invoked it, preserving strong typing and
simple code in your handler. This would be a new object per method call.
I might prototype this if it would be helpful to you. Or you could, if you
like. (Email me to discuss it further if you're interested.)
Regards,
Rod
----- Original Message -----
From: "Rajeev Kaul" <Ra...@cu...>
To: <spr...@li...>
Sent: Thursday, October 02, 2003 9:06 PM
Subject: [Springframework-developer] wiring business objects
What is the best way to wire business objects to the web handlers? I want
to keep a shared instance of the handlers for my web requests. But each
request must work with a new instance of a business object. If I set a
property for the "singleton" handler to a business objct, then won't it
always fetch the same instance (of business object) , no matter what I
specify for "singleton" attribute of the business object in the application
context? I am thinking of using an intermediary like a business object
factory, which will ensure that I get a new instance of the business object
every time, and not specify the business object in the application context.
Is there a better way of dealing with it in Spring?
Rajeev Kaul
Customer Care, Inc.
925 277 069
|
|
From: Lars F. <lar...@gm...> - 2003-10-04 11:19:42
|
Maybe you should give IDEA a try ... > Well, it does and it doesn't. That is, there is no way on a project by > project basis to set the tab key to spit out tabs or spaces when you press > Tab to indent. And there is no easy way to switch back and forth; you > actually have to go to two separate places in the preferences. There is > also no easy way to switch the defined tab/indent size, only via the > preferences. Actually, if Eclipse is set for spaces, there is no way to > even spit out a hard tab. This all basically means you have to use one > worksapce for your projects that use spaces for indents, and one for > your projects that use tabs. > > Anyways, while I personally don't like them, I respect everyone's right > to like them, and I understand the history here :-). I just wanted to > know what the policy was... > > > Kopylenko, Dmitry wrote: > > >I also use tabs and Eclipse supports them very well ;-) > > > >Dmitriy. > > > >-----Original Message----- > >From: Rod Johnson [mailto:rod...@in...] > >Sent: Wednesday, October 01, 2003 3:37 AM > >To: Colin Sampaleanu; jue...@we... > >Cc: Spring Developers > >Subject: Re: [Springframework-developer] Any sort of defined policy > >w/regards to tab/space usage and indentation? > > > > > >The use of tabs is historical. I'm in the minority of people who use > tabs, > >so the original code base had tabs and I still use them. I know most > people > >in open source projects hate tabs, so we might eventually need to change > >this. > > > >We did consider the use of Jalopy before check in at one point. > > > >I'd prefer not to mess with the formatting process before 1.0 unless we > >really need to. > > > >Regards, > >Rod > > > >----- Original Message ----- > >From: "Colin Sampaleanu" <col...@ex...> > >To: <rod...@in...>; <jue...@we...> > >Cc: "Spring Developers" <spr...@li...> > >Sent: Tuesday, September 30, 2003 10:14 PM > >Subject: [Springframework-developer] Any sort of defined policy w/regards > to > >tab/space usage and indentation? > > > > > > > > > >>I notice that most of the codebase in Spring uses hard tabs as opposed > >>to spaces for indentation. From looking at some comment text which > >>does have some embedded spaces, as far as I can tell the assumption is > >>that tabs equate to 4 chars, although most of the code itself does not > >>seem to make this assumption? > >> > >>Is there any sort of project policy or guideline on this? i.e. > >>something like 'all code must use hard tabs, and align elements only > >>with tabs', etc.? I can hopefully work with any policy, but I'd just > >>like to know if one exists... (although if I am forced to use hard > >>tabs I would actually have to set up another Eclipse workspace, right > >>now my tab key puts out spaces). > >> > >>fwiw, I have personally found that hard tabs are somewhat of a > >>disaster (or at least a problem) in many team environents. In my > >>teams, it's generally the one rule we apply with no exceptions, "no > >>hard tabs". The problem is that while hard tabs have the ideal benefit > >>of allowing users to indent to whatever size they like, in practice > >>people seem to not have the discipline to stick to using tabs only, or > >>their editor of the moment doesn't allow them to set the tab size to > >>something else easilly, so spaces creep in. Once that happens to any > >>extent, the code looks broken to anybody else using another tab size. > >> > >>Regards, > >>Colin > >> > >> > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-03 13:09:57
|
Done.
Dmitriy.
-----Original Message-----
From: Alef Arendsen (JTeam) [mailto:al...@jt...]=20
Sent: Thursday, October 02, 2003 3:06 PM
To: 'Kopylenko, Dmitry'; 'j=FCrgen h=F6ller [werk3AT]'; 'Spring =
Developers'
Subject: RE: [Springframework-developer] New addition to BindTag
Dmitry,
There's some documentation about the tags in docs/taglib, would you =
mind
updating them the newly including property? I can do it as well, but =
haven't
got much time right now...
Thnx,
Alef
-----Oorspronkelijk bericht-----
Van: spr...@li...
[mailto:spr...@li...] Namens
Kopylenko, Dmitry
Verzonden: Thursday, October 02, 2003 5:32 PM
Aan: 'j=FCrgen h=F6ller [werk3AT]'; Kopylenko, Dmitry; 'Spring =
Developers'
Onderwerp: RE: [Springframework-developer] New addition to BindTag
I've now committed the suggested change. The behavior of this tag is =
now
based on the "property" parameter:
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
Regards,
Dmitriy
-----Original Message-----
From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20
Sent: Thursday, October 02, 2003 5:13 AM
To: Kopylenko, Dmitry; Spring Developers
Subject: Re: [Springframework-developer] New addition to BindTag
Dmitriy,
=20
That's definitely useful. I'm wondering if there's an alternative to a
"showAllErrors" boolean, though - as this parameter is just applied if
parameter "property" is empty. We could for example define =
"property=3D*" as
showing all errors, for all properties. That would mean:
=20
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
=20
The good thing would be that there's no ambiguity, i.e. no invalid
combinations of parameters.
=20
Juergen
=20
-----Urspr=FCngliche Nachricht-----=20
Von: Kopylenko, Dmitry [mailto:dko...@ac...]=20
Gesendet: Mi 01.10.2003 15:00=20
An: 'Spring Developers'=20
Cc:=20
Betreff: [Springframework-developer] New addition to BindTag
=09
=09
Hello everyone,=20
I came across the following limitation in using BindTag to render
ObjectErrors (in our case anyway :-). The thing is that we use generic =
JSP
to render validation errors which we include in each JSP by using it =
like
this:
<spring:bind path=3D"${command}">=20
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
By using it like this(without specifying property name) it shows
only "Global Errors, but we need to show all errors (like typeMismatch
etc.)
So, I've added an optional boolean attribute to the tag called
showAllErrors and when it's set to "true" then the tag will expose all
errors. By default it's false:
<spring:bind path=3D"${command}" =
showAllErrors=3D"true">
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
Here are the code changes in BindTag.java:=20
private boolean showAllErrors =3D false;=20
public void setShowAllErrors(String showAllErrors){=20
CustomBooleanEditor booleanEditor =3D new
CustomBooleanEditor(false);=20
booleanEditor.setAsText(showAllErrors);=20
this.showAllErrors =3D
((Boolean)booleanEditor.getValue()).booleanValue();=20
}=20
protected int doStartTagInternal() throws Exception {=20
//...Previous code=20
if (this.property !=3D null) {=20
fes =3D this.errors.getFieldErrors(this.property);=20
value =3D this.errors.getFieldValue(this.property);=20
editor =3D this.errors.getCustomEditor(this.property);=20
if (isHtmlEscape() && value instanceof String) {=20
value =3D HtmlUtils.htmlEscape((String) value);=20
}=20
}=20
//This is my change=20
else {=20
if(showAllErrors)=20
fes =3D this.errors.getAllErrors();=20
else=20
fes =3D this.errors.getGlobalErrors();=20
}=20
If there are no serious objections, I could commit this.=20
Regards,=20
Dmitriy.=20
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Rajeev K. <Ra...@cu...> - 2003-10-02 20:06:30
|
What is the best way to wire business objects to the web handlers? I = want to keep a shared instance of the handlers for my web requests. But = each request must work with a new instance of a business object. If I = set a property for the "singleton" handler to a business object, then = won't it always fetch the same instance (of business object) , no matter = what I specify for "singleton" attribute of the business object in the = application context? I am thinking of using an intermediary like a = business object factory, which will ensure that I get a new instance of = the business object every time, and not specify the business object in = the application context. Is there a better way of dealing with it in = Spring? Rajeev Kaul Customer Care, Inc. 925 277 0696 |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-10-02 19:05:29
|
Dmitry,
There's some documentation about the tags in docs/taglib, would you mind
updating them the newly including property? I can do it as well, but
haven't got much time right now...
Thnx,
Alef
-----Oorspronkelijk bericht-----
Van: spr...@li...
[mailto:spr...@li...] Namens
Kopylenko, Dmitry
Verzonden: Thursday, October 02, 2003 5:32 PM
Aan: 'j=FCrgen h=F6ller [werk3AT]'; Kopylenko, Dmitry; 'Spring =
Developers'
Onderwerp: RE: [Springframework-developer] New addition to BindTag
I've now committed the suggested change. The behavior of this tag is now
based on the "property" parameter:
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
Regards,
Dmitriy
-----Original Message-----
From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20
Sent: Thursday, October 02, 2003 5:13 AM
To: Kopylenko, Dmitry; Spring Developers
Subject: Re: [Springframework-developer] New addition to BindTag
Dmitriy,
=20
That's definitely useful. I'm wondering if there's an alternative to a
"showAllErrors" boolean, though - as this parameter is just applied if
parameter "property" is empty. We could for example define =
"property=3D*"
as showing all errors, for all properties. That would mean:
=20
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
=20
The good thing would be that there's no ambiguity, i.e. no invalid
combinations of parameters.
=20
Juergen
=20
-----Urspr=FCngliche Nachricht-----=20
Von: Kopylenko, Dmitry [mailto:dko...@ac...]=20
Gesendet: Mi 01.10.2003 15:00=20
An: 'Spring Developers'=20
Cc:=20
Betreff: [Springframework-developer] New addition to BindTag
=09
=09
Hello everyone,=20
I came across the following limitation in using BindTag to
render ObjectErrors (in our case anyway :-). The thing is that we use
generic JSP to render validation errors which we include in each JSP by
using it like
this:
<spring:bind path=3D"${command}">=20
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
By using it like this(without specifying property name) it shows
only "Global Errors, but we need to show all errors (like typeMismatch
etc.)
So, I've added an optional boolean attribute to the tag called
showAllErrors and when it's set to "true" then the tag will expose all
errors. By default it's false:
<spring:bind path=3D"${command}"
showAllErrors=3D"true">
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
Here are the code changes in BindTag.java:=20
private boolean showAllErrors =3D false;=20
public void setShowAllErrors(String showAllErrors){=20
CustomBooleanEditor booleanEditor =3D new
CustomBooleanEditor(false);=20
booleanEditor.setAsText(showAllErrors);=20
this.showAllErrors =3D
((Boolean)booleanEditor.getValue()).booleanValue();=20
}=20
protected int doStartTagInternal() throws Exception {=20
//...Previous code=20
if (this.property !=3D null) {=20
fes =3D this.errors.getFieldErrors(this.property);=20
value =3D this.errors.getFieldValue(this.property);=20
editor =3D this.errors.getCustomEditor(this.property);=20
if (isHtmlEscape() && value instanceof String) {=20
value =3D HtmlUtils.htmlEscape((String) value);=20
}=20
}=20
//This is my change=20
else {=20
if(showAllErrors)=20
fes =3D this.errors.getAllErrors();=20
else=20
fes =3D this.errors.getGlobalErrors();=20
}=20
If there are no serious objections, I could commit this.=20
Regards,=20
Dmitriy.=20
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Colin S. <col...@ex...> - 2003-10-02 17:19:41
|
This has absolutely nothing to do with current Spring functionality, but I though Spring developers might find mod_pubsub interesting, since the mechanism used is fairly uncommon so far, and there are some interesing possible applications. http://www.mod-pubsub.org/ |
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-02 15:31:59
|
I've now committed the suggested change. The behavior of this tag is =
now
based on the "property" parameter:
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
Regards,
Dmitriy
-----Original Message-----
From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20
Sent: Thursday, October 02, 2003 5:13 AM
To: Kopylenko, Dmitry; Spring Developers
Subject: Re: [Springframework-developer] New addition to BindTag
Dmitriy,
=20
That's definitely useful. I'm wondering if there's an alternative to a
"showAllErrors" boolean, though - as this parameter is just applied if
parameter "property" is empty. We could for example define =
"property=3D*" as
showing all errors, for all properties. That would mean:
=20
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
=20
The good thing would be that there's no ambiguity, i.e. no invalid
combinations of parameters.
=20
Juergen
=20
-----Urspr=FCngliche Nachricht-----=20
Von: Kopylenko, Dmitry [mailto:dko...@ac...]=20
Gesendet: Mi 01.10.2003 15:00=20
An: 'Spring Developers'=20
Cc:=20
Betreff: [Springframework-developer] New addition to BindTag
=09
=09
Hello everyone,=20
I came across the following limitation in using BindTag to render
ObjectErrors (in our case anyway :-). The thing is that we use generic =
JSP
to render validation errors which we include in each JSP by using it =
like
this:
<spring:bind path=3D"${command}">=20
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">=20
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
By using it like this(without specifying property name) it shows
only "Global Errors, but we need to show all errors (like typeMismatch =
etc.)
So, I've added an optional boolean attribute to the tag called
showAllErrors and when it's set to "true" then the tag will expose all
errors. By default it's false:
<spring:bind path=3D"${command}" =
showAllErrors=3D"true">
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">=20
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
Here are the code changes in BindTag.java:=20
private boolean showAllErrors =3D false;=20
public void setShowAllErrors(String showAllErrors){=20
CustomBooleanEditor booleanEditor =3D new
CustomBooleanEditor(false);=20
booleanEditor.setAsText(showAllErrors);=20
this.showAllErrors =3D
((Boolean)booleanEditor.getValue()).booleanValue();=20
}=20
protected int doStartTagInternal() throws Exception {=20
//...Previous code=20
if (this.property !=3D null) {=20
fes =3D this.errors.getFieldErrors(this.property);=20
value =3D this.errors.getFieldValue(this.property);=20
editor =3D this.errors.getCustomEditor(this.property);=20
if (isHtmlEscape() && value instanceof String) {=20
value =3D HtmlUtils.htmlEscape((String) value);=20
}=20
}=20
//This is my change=20
else {=20
if(showAllErrors)=20
fes =3D this.errors.getAllErrors();=20
else=20
fes =3D this.errors.getGlobalErrors();=20
}=20
If there are no serious objections, I could commit this.=20
Regards,=20
Dmitriy.=20
|
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-02 11:59:43
|
Juergen,
This looks cleaner ;-) I'll try to implement your suggestion.
Regards,
Dmitriy.
-----Original Message-----
From: j=FCrgen h=F6ller [werk3AT] [mailto:jue...@we...]=20
Sent: Thursday, October 02, 2003 5:13 AM
To: Kopylenko, Dmitry; Spring Developers
Subject: Re: [Springframework-developer] New addition to BindTag
Dmitriy,
=20
That's definitely useful. I'm wondering if there's an alternative to a
"showAllErrors" boolean, though - as this parameter is just applied if
parameter "property" is empty. We could for example define =
"property=3D*" as
showing all errors, for all properties. That would mean:
=20
- "property" empty =3D global errors
- "property=3DmyProperty" =3D just the errors for "myProperty"
- "property=3D*" =3D all errors, both global and for all properties
=20
The good thing would be that there's no ambiguity, i.e. no invalid
combinations of parameters.
=20
Juergen
=20
-----Urspr=FCngliche Nachricht-----=20
Von: Kopylenko, Dmitry [mailto:dko...@ac...]=20
Gesendet: Mi 01.10.2003 15:00=20
An: 'Spring Developers'=20
Cc:=20
Betreff: [Springframework-developer] New addition to BindTag
=09
=09
Hello everyone,=20
I came across the following limitation in using BindTag to render
ObjectErrors (in our case anyway :-). The thing is that we use generic =
JSP
to render validation errors which we include in each JSP by using it =
like
this:
<spring:bind path=3D"${command}">=20
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">=20
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
By using it like this(without specifying property name) it shows
only "Global Errors, but we need to show all errors (like typeMismatch =
etc.)
So, I've added an optional boolean attribute to the tag called
showAllErrors and when it's set to "true" then the tag will expose all
errors. By default it's false:
<spring:bind path=3D"${command}" =
showAllErrors=3D"true">
<div class=3D"error">=20
<ul style=3D"margin:0;padding:0;">=20
<c:forEach
items=3D"${status.errorMessages}" var=3D"msg">=20
<li><c:out
value=3D"${msg}"/></li>=20
</c:forEach>=20
</ul>=20
</div>=20
</spring:bind>=20
Here are the code changes in BindTag.java:=20
private boolean showAllErrors =3D false;=20
public void setShowAllErrors(String showAllErrors){=20
CustomBooleanEditor booleanEditor =3D new
CustomBooleanEditor(false);=20
booleanEditor.setAsText(showAllErrors);=20
this.showAllErrors =3D
((Boolean)booleanEditor.getValue()).booleanValue();=20
}=20
protected int doStartTagInternal() throws Exception {=20
//...Previous code=20
if (this.property !=3D null) {=20
fes =3D this.errors.getFieldErrors(this.property);=20
value =3D this.errors.getFieldValue(this.property);=20
editor =3D this.errors.getCustomEditor(this.property);=20
if (isHtmlEscape() && value instanceof String) {=20
value =3D HtmlUtils.htmlEscape((String) value);=20
}=20
}=20
//This is my change=20
else {=20
if(showAllErrors)=20
fes =3D this.errors.getAllErrors();=20
else=20
fes =3D this.errors.getGlobalErrors();=20
}=20
If there are no serious objections, I could commit this.=20
Regards,=20
Dmitriy.=20
|
|
From: <jue...@we...> - 2003-10-02 09:15:06
|
RG1pdHJpeSwNCiANClRoYXQncyBkZWZpbml0ZWx5IHVzZWZ1bC4gSSdtIHdvbmRlcmluZyBpZiB0 aGVyZSdzIGFuIGFsdGVybmF0aXZlIHRvIGEgInNob3dBbGxFcnJvcnMiIGJvb2xlYW4sIHRob3Vn aCAtIGFzIHRoaXMgcGFyYW1ldGVyIGlzIGp1c3QgYXBwbGllZCBpZiBwYXJhbWV0ZXIgInByb3Bl cnR5IiBpcyBlbXB0eS4gV2UgY291bGQgZm9yIGV4YW1wbGUgZGVmaW5lICJwcm9wZXJ0eT0qIiBh cyBzaG93aW5nIGFsbCBlcnJvcnMsIGZvciBhbGwgcHJvcGVydGllcy4gVGhhdCB3b3VsZCBtZWFu Og0KIA0KLSAicHJvcGVydHkiIGVtcHR5ID0gZ2xvYmFsIGVycm9ycw0KLSAicHJvcGVydHk9bXlQ cm9wZXJ0eSIgPSBqdXN0IHRoZSBlcnJvcnMgZm9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AgICAgICAgICAgICAgIDx1bCBzdHlsZT0ibWFy Z2luOjA7cGFkZGluZzowOyI+IA0KCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICA8Yzpmb3JFYWNoIGl0ZW1zPSIke3N0YXR1cy5lcnJvck1lc3NhZ2VzfSIgdmFyPSJtc2ci PiANCgkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bGk+ PGM6b3V0IHZhbHVlPSIke21zZ30iLz48L2xpPiANCgkgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgPC9jOmZvckVhY2g+IA0KCSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgPC91bD4gDQoJICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+IA0KCSAgICAgICAg ICAgICAgICA8L3NwcmluZzpiaW5kPiANCg0KCUJ5IHVzaW5nIGl0IGxpa2UgdGhpcyh3aXRob3V0 IHNwZWNpZnlpbmcgcHJvcGVydHkgbmFtZSkgaXQgc2hvd3Mgb25seSAiR2xvYmFsIEVycm9ycywg YnV0IHdlIG5lZWQgdG8gc2hvdyBhbGwgZXJyb3JzIChsaWtlIHR5cGVNaXNtYXRjaCBldGMuKQ0K DQoJU28sIEkndmUgYWRkZWQgYW4gb3B0aW9uYWwgYm9vbGVhbiBhdHRyaWJ1dGUgdG8gdGhlIHRh ZyBjYWxsZWQgc2hvd0FsbEVycm9ycyBhbmQgd2hlbiBpdCdzIHNldCB0byAidHJ1ZSIgdGhlbiB0 aGUgdGFnIHdpbGwgZXhwb3NlIGFsbCBlcnJvcnMuIEJ5IGRlZmF1bHQgaXQncyBmYWxzZToNCg0K CSAgICAgICAgICAgICAgICA8c3ByaW5nOmJpbmQgcGF0aD0iJHtjb21tYW5kfSIgc2hvd0FsbEVy cm9ycz0idHJ1ZSI+IA0KCSAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImVycm9y Ij4gDQoJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dWwgc3R5bGU9Im1hcmdpbjow O3BhZGRpbmc6MDsiPiANCgkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg PGM6Zm9yRWFjaCBpdGVtcz0iJHtzdGF0dXMuZXJyb3JNZXNzYWdlc30iIHZhcj0ibXNnIj4gDQoJ ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGxpPjxjOm91 dCB2YWx1ZT0iJHttc2d9Ii8+PC9saT4gDQoJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDwvYzpmb3JFYWNoPiANCgkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDwvdWw+IA0KCSAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PiANCgkgICAgICAgICAgICAg ICAgPC9zcHJpbmc6YmluZD4gDQoNCglIZXJlIGFyZSB0aGUgY29kZSBjaGFuZ2VzIGluIEJpbmRU YWcuamF2YTogDQoNCglwcml2YXRlIGJvb2xlYW4gc2hvd0FsbEVycm9ycyA9IGZhbHNlOyANCg0K CXB1YmxpYyB2b2lkIHNldFNob3dBbGxFcnJvcnMoU3RyaW5nIHNob3dBbGxFcnJvcnMpeyANCgkg ICAgICAgIEN1c3RvbUJvb2xlYW5FZGl0b3IgYm9vbGVhbkVkaXRvciA9IG5ldyBDdXN0b21Cb29s ZWFuRWRpdG9yKGZhbHNlKTsgDQoJICAgICAgICBib29sZWFuRWRpdG9yLnNldEFzVGV4dChzaG93 QWxsRXJyb3JzKTsgDQoJICAgICAgICB0aGlzLnNob3dBbGxFcnJvcnMgPSAoKEJvb2xlYW4pYm9v bGVhbkVkaXRvci5nZXRWYWx1ZSgpKS5ib29sZWFuVmFsdWUoKTsgDQoJfSANCg0KCXByb3RlY3Rl ZCBpbnQgZG9TdGFydFRhZ0ludGVybmFsKCkgdGhyb3dzIEV4Y2VwdGlvbiB7IA0KDQoJLy8uLi5Q cmV2aW91cyBjb2RlIA0KDQoJaWYgKHRoaXMucHJvcGVydHkgIT0gbnVsbCkgeyANCgkgICAgICAg IGZlcyA9IHRoaXMuZXJyb3JzLmdldEZpZWxkRXJyb3JzKHRoaXMucHJvcGVydHkpOyANCgkgICAg ICAgIHZhbHVlID0gdGhpcy5lcnJvcnMuZ2V0RmllbGRWYWx1ZSh0aGlzLnByb3BlcnR5KTsgDQoJ ICAgICAgICBlZGl0b3IgPSB0aGlzLmVycm9ycy5nZXRDdXN0b21FZGl0b3IodGhpcy5wcm9wZXJ0 eSk7IA0KCSAgICAgICAgaWYgKGlzSHRtbEVzY2FwZSgpICYmIHZhbHVlIGluc3RhbmNlb2YgU3Ry aW5nKSB7IA0KCSAgICAgICAgICAgICAgICB2YWx1ZSA9IEh0bWxVdGlscy5odG1sRXNjYXBlKChT dHJpbmcpIHZhbHVlKTsgDQoJICAgICAgICB9IA0KCX0gDQoJLy9UaGlzIGlzIG15IGNoYW5nZSAN CgllbHNlIHsgDQoJICAgICAgICBpZihzaG93QWxsRXJyb3JzKSANCgkgICAgICAgICAgICAgICAg ZmVzID0gdGhpcy5lcnJvcnMuZ2V0QWxsRXJyb3JzKCk7IA0KCSAgICAgICAgZWxzZSANCgkgICAg ICAgICAgICAgICAgZmVzID0gdGhpcy5lcnJvcnMuZ2V0R2xvYmFsRXJyb3JzKCk7IA0KCX0gDQoN CglJZiB0aGVyZSBhcmUgbm8gc2VyaW91cyBvYmplY3Rpb25zLCBJIGNvdWxkIGNvbW1pdCB0aGlz LiANCg0KCVJlZ2FyZHMsIA0KCURtaXRyaXkuIA0KDQo= |
|
From: Colin S. <col...@ex...> - 2003-10-01 14:32:05
|
I took a better look at Jalopy. My only previous experience with it had been with the OSWorkflow project, where a build seemed to modify every file, as a result of Jalopy running. Now in fact, the Jalopy ant task is smart enough to use a checksum to not touch files which don't end up getting reformatted, and the OSWorkflow guys were not overriding this. However, they were forcing it to use unix line endings, even on windows systems. So Jalopy would probably be a realistic option. There is a plugin for Eclipse too... Regards, Colin Colin Sampaleanu wrote: > I think the only issue with using Jalopy before checkin is that CVS is > not really optimized for this; unless Jalopy is smart enough to not > touch file dates on files that don't get reformatted, you end up doing > a diff on every file to do a checkin. I realize that only the actually > modified files get checked in, but the contents still get set across, > since CVS doesn't keep local original versions (like say Subversion, > which is optimized to reduce bandwidth usage at the expense of local > space). > > Regards, > Colin > > Rod Johnson wrote: > >> The use of tabs is historical. I'm in the minority of people who use >> tabs, >> so the original code base had tabs and I still use them. I know most >> people >> in open source projects hate tabs, so we might eventually need to change >> this. >> >> We did consider the use of Jalopy before check in at one point. >> >> I'd prefer not to mess with the formatting process before 1.0 unless we >> really need to. >> >> Regards, >> Rod >> >> ----- Original Message ----- From: "Colin Sampaleanu" >> <col...@ex...> >> To: <rod...@in...>; <jue...@we...> >> Cc: "Spring Developers" >> <spr...@li...> >> Sent: Tuesday, September 30, 2003 10:14 PM >> Subject: [Springframework-developer] Any sort of defined policy >> w/regards to >> tab/space usage and indentation? >> >> >> >> >>> I notice that most of the codebase in Spring uses hard tabs as opposed >>> to spaces for indentation. From looking at some comment text which does >>> have some embedded spaces, as far as I can tell the assumption is that >>> tabs equate to 4 chars, although most of the code itself does not seem >>> to make this assumption? >>> >>> Is there any sort of project policy or guideline on this? i.e. >>> something >>> like 'all code must use hard tabs, and align elements only with tabs', >>> etc.? I can hopefully work with any policy, but I'd just like to >>> know if >>> one exists... (although if I am forced to use hard tabs I would >>> actually >>> have to set up another Eclipse workspace, right now my tab key puts out >>> spaces). >>> >>> fwiw, I have personally found that hard tabs are somewhat of a disaster >>> (or at least a problem) in many team environents. In my teams, it's >>> generally the one rule we apply with no exceptions, "no hard tabs". The >>> problem is that while hard tabs have the ideal benefit of allowing >>> users >>> to indent to whatever size they like, in practice people seem to not >>> have the discipline to stick to using tabs only, or their editor of the >>> moment doesn't allow them to set the tab size to something else >>> easilly, >>> so spaces creep in. Once that happens to any extent, the code looks >>> broken to anybody else using another tab size. >>> >>> Regards, >>> Colin >>> >> |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-10-01 13:23:28
|
Seems useful, as long as the default is indeed false it;s ok with me...
By the way, I recently added the transform tag (to also transform
reference data using hte same propertyeditors in the object). I did
_not_ include it in the TLD yet, maybe people want to first check it
out...
alef
-----Oorspronkelijk bericht-----
Van: spr...@li...
[mailto:spr...@li...] Namens
Kopylenko, Dmitry
Verzonden: Wednesday, October 01, 2003 3:01 PM
Aan: 'Spring Developers'
Onderwerp: [Springframework-developer] New addition to BindTag
Hello everyone,
I came across the following limitation in using BindTag to render
ObjectErrors (in our case anyway :-). The thing is that we use generic
JSP to render validation errors which we include in each JSP by using it
like this:
<spring:bind path="${command}">
<div class="error">
<ul style="margin:0;padding:0;">
<c:forEach
items="${status.errorMessages}" var="msg">
<li><c:out
value="${msg}"/></li>
</c:forEach>
</ul>
</div>
</spring:bind>
By using it like this(without specifying property name) it shows only
"Global Errors, but we need to show all errors (like typeMismatch etc.)
So, I've added an optional boolean attribute to the tag called
showAllErrors and when it's set to "true" then the tag will expose all
errors. By default it's false:
<spring:bind path="${command}" showAllErrors="true">
<div class="error">
<ul style="margin:0;padding:0;">
<c:forEach
items="${status.errorMessages}" var="msg">
<li><c:out
value="${msg}"/></li>
</c:forEach>
</ul>
</div>
</spring:bind>
Here are the code changes in BindTag.java:
private boolean showAllErrors = false;
public void setShowAllErrors(String showAllErrors){
CustomBooleanEditor booleanEditor = new
CustomBooleanEditor(false);
booleanEditor.setAsText(showAllErrors);
this.showAllErrors =
((Boolean)booleanEditor.getValue()).booleanValue();
}
protected int doStartTagInternal() throws Exception {
//...Previous code
if (this.property != null) {
fes = this.errors.getFieldErrors(this.property);
value = this.errors.getFieldValue(this.property);
editor = this.errors.getCustomEditor(this.property);
if (isHtmlEscape() && value instanceof String) {
value = HtmlUtils.htmlEscape((String) value);
}
}
//This is my change
else {
if(showAllErrors)
fes = this.errors.getAllErrors();
else
fes = this.errors.getGlobalErrors();
}
If there are no serious objections, I could commit this.
Regards,
Dmitriy.
|
|
From: Kopylenko, D. <dko...@ac...> - 2003-10-01 13:00:54
|
Hello everyone,
I came across the following limitation in using BindTag to render
ObjectErrors (in our case anyway :-). The thing is that we use generic JSP
to render validation errors which we include in each JSP by using it like
this:
<spring:bind path="${command}">
<div class="error">
<ul style="margin:0;padding:0;">
<c:forEach
items="${status.errorMessages}" var="msg">
<li><c:out
value="${msg}"/></li>
</c:forEach>
</ul>
</div>
</spring:bind>
By using it like this(without specifying property name) it shows only
"Global Errors, but we need to show all errors (like typeMismatch etc.)
So, I've added an optional boolean attribute to the tag called showAllErrors
and when it's set to "true" then the tag will expose all errors. By default
it's false:
<spring:bind path="${command}" showAllErrors="true">
<div class="error">
<ul style="margin:0;padding:0;">
<c:forEach
items="${status.errorMessages}" var="msg">
<li><c:out
value="${msg}"/></li>
</c:forEach>
</ul>
</div>
</spring:bind>
Here are the code changes in BindTag.java:
private boolean showAllErrors = false;
public void setShowAllErrors(String showAllErrors){
CustomBooleanEditor booleanEditor = new CustomBooleanEditor(false);
booleanEditor.setAsText(showAllErrors);
this.showAllErrors =
((Boolean)booleanEditor.getValue()).booleanValue();
}
protected int doStartTagInternal() throws Exception {
//...Previous code
if (this.property != null) {
fes = this.errors.getFieldErrors(this.property);
value = this.errors.getFieldValue(this.property);
editor = this.errors.getCustomEditor(this.property);
if (isHtmlEscape() && value instanceof String) {
value = HtmlUtils.htmlEscape((String) value);
}
}
//This is my change
else {
if(showAllErrors)
fes = this.errors.getAllErrors();
else
fes = this.errors.getGlobalErrors();
}
If there are no serious objections, I could commit this.
Regards,
Dmitriy.
|
|
From: Trevor C. <pr...@se...> - 2003-10-01 12:46:22
|
I use tabs, but I tend to ignore most formatting, using the "auto-format" function of Eclipse routinely. The only problem with this is that it will mess up CVS if you reformat and submit. Trevor -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Rod Johnson Sent: October 1, 2003 3:37 AM To: Colin Sampaleanu; jue...@we... Cc: Spring Developers Subject: Re: [Springframework-developer] Any sort of defined policy w/regards to tab/space usage and indentation? The use of tabs is historical. I'm in the minority of people who use tabs, so the original code base had tabs and I still use them. I know most people in open source projects hate tabs, so we might eventually need to change this. We did consider the use of Jalopy before check in at one point. I'd prefer not to mess with the formatting process before 1.0 unless we really need to. Regards, Rod ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <rod...@in...>; <jue...@we...> Cc: "Spring Developers" <spr...@li...> Sent: Tuesday, September 30, 2003 10:14 PM Subject: [Springframework-developer] Any sort of defined policy w/regards to tab/space usage and indentation? > I notice that most of the codebase in Spring uses hard tabs as opposed > to spaces for indentation. From looking at some comment text which does > have some embedded spaces, as far as I can tell the assumption is that > tabs equate to 4 chars, although most of the code itself does not seem > to make this assumption? > > Is there any sort of project policy or guideline on this? i.e. something > like 'all code must use hard tabs, and align elements only with tabs', > etc.? I can hopefully work with any policy, but I'd just like to know if > one exists... (although if I am forced to use hard tabs I would actually > have to set up another Eclipse workspace, right now my tab key puts out > spaces). > > fwiw, I have personally found that hard tabs are somewhat of a disaster > (or at least a problem) in many team environents. In my teams, it's > generally the one rule we apply with no exceptions, "no hard tabs". The > problem is that while hard tabs have the ideal benefit of allowing users > to indent to whatever size they like, in practice people seem to not > have the discipline to stick to using tabs only, or their editor of the > moment doesn't allow them to set the tab size to something else easilly, > so spaces creep in. Once that happens to any extent, the code looks > broken to anybody else using another tab size. > > Regards, > Colin > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2003-10-01 12:27:25
|
I think the only issue with using Jalopy before checkin is that CVS is not really optimized for this; unless Jalopy is smart enough to not touch file dates on files that don't get reformatted, you end up doing a diff on every file to do a checkin. I realize that only the actually modified files get checked in, but the contents still get set across, since CVS doesn't keep local original versions (like say Subversion, which is optimized to reduce bandwidth usage at the expense of local space). Regards, Colin Rod Johnson wrote: >The use of tabs is historical. I'm in the minority of people who use tabs, >so the original code base had tabs and I still use them. I know most people >in open source projects hate tabs, so we might eventually need to change >this. > >We did consider the use of Jalopy before check in at one point. > >I'd prefer not to mess with the formatting process before 1.0 unless we >really need to. > >Regards, >Rod > >----- Original Message ----- >From: "Colin Sampaleanu" <col...@ex...> >To: <rod...@in...>; <jue...@we...> >Cc: "Spring Developers" <spr...@li...> >Sent: Tuesday, September 30, 2003 10:14 PM >Subject: [Springframework-developer] Any sort of defined policy w/regards to >tab/space usage and indentation? > > > > >>I notice that most of the codebase in Spring uses hard tabs as opposed >>to spaces for indentation. From looking at some comment text which does >>have some embedded spaces, as far as I can tell the assumption is that >>tabs equate to 4 chars, although most of the code itself does not seem >>to make this assumption? >> >>Is there any sort of project policy or guideline on this? i.e. something >>like 'all code must use hard tabs, and align elements only with tabs', >>etc.? I can hopefully work with any policy, but I'd just like to know if >>one exists... (although if I am forced to use hard tabs I would actually >>have to set up another Eclipse workspace, right now my tab key puts out >>spaces). >> >>fwiw, I have personally found that hard tabs are somewhat of a disaster >>(or at least a problem) in many team environents. In my teams, it's >>generally the one rule we apply with no exceptions, "no hard tabs". The >>problem is that while hard tabs have the ideal benefit of allowing users >>to indent to whatever size they like, in practice people seem to not >>have the discipline to stick to using tabs only, or their editor of the >>moment doesn't allow them to set the tab size to something else easilly, >>so spaces creep in. Once that happens to any extent, the code looks >>broken to anybody else using another tab size. >> >>Regards, >>Colin >> >> |
|
From: Colin S. <col...@ex...> - 2003-10-01 12:23:44
|
Well, it does and it doesn't. That is, there is no way on a project by project basis to set the tab key to spit out tabs or spaces when you press Tab to indent. And there is no easy way to switch back and forth; you actually have to go to two separate places in the preferences. There is also no easy way to switch the defined tab/indent size, only via the preferences. Actually, if Eclipse is set for spaces, there is no way to even spit out a hard tab. This all basically means you have to use one worksapce for your projects that use spaces for indents, and one for your projects that use tabs. Anyways, while I personally don't like them, I respect everyone's right to like them, and I understand the history here :-). I just wanted to know what the policy was... Kopylenko, Dmitry wrote: >I also use tabs and Eclipse supports them very well ;-) > >Dmitriy. > >-----Original Message----- >From: Rod Johnson [mailto:rod...@in...] >Sent: Wednesday, October 01, 2003 3:37 AM >To: Colin Sampaleanu; jue...@we... >Cc: Spring Developers >Subject: Re: [Springframework-developer] Any sort of defined policy >w/regards to tab/space usage and indentation? > > >The use of tabs is historical. I'm in the minority of people who use tabs, >so the original code base had tabs and I still use them. I know most people >in open source projects hate tabs, so we might eventually need to change >this. > >We did consider the use of Jalopy before check in at one point. > >I'd prefer not to mess with the formatting process before 1.0 unless we >really need to. > >Regards, >Rod > >----- Original Message ----- >From: "Colin Sampaleanu" <col...@ex...> >To: <rod...@in...>; <jue...@we...> >Cc: "Spring Developers" <spr...@li...> >Sent: Tuesday, September 30, 2003 10:14 PM >Subject: [Springframework-developer] Any sort of defined policy w/regards to >tab/space usage and indentation? > > > > >>I notice that most of the codebase in Spring uses hard tabs as opposed >>to spaces for indentation. From looking at some comment text which >>does have some embedded spaces, as far as I can tell the assumption is >>that tabs equate to 4 chars, although most of the code itself does not >>seem to make this assumption? >> >>Is there any sort of project policy or guideline on this? i.e. >>something like 'all code must use hard tabs, and align elements only >>with tabs', etc.? I can hopefully work with any policy, but I'd just >>like to know if one exists... (although if I am forced to use hard >>tabs I would actually have to set up another Eclipse workspace, right >>now my tab key puts out spaces). >> >>fwiw, I have personally found that hard tabs are somewhat of a >>disaster (or at least a problem) in many team environents. In my >>teams, it's generally the one rule we apply with no exceptions, "no >>hard tabs". The problem is that while hard tabs have the ideal benefit >>of allowing users to indent to whatever size they like, in practice >>people seem to not have the discipline to stick to using tabs only, or >>their editor of the moment doesn't allow them to set the tab size to >>something else easilly, so spaces creep in. Once that happens to any >>extent, the code looks broken to anybody else using another tab size. >> >>Regards, >>Colin >> >> |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-10-01 12:08:30
|
Ongoing discussion in the company here. I use tabs all the time and the other people don't want to adjust the checkstyle properties to I keep on getting remarks abou my tabs (but I keep using them)! -----Oorspronkelijk bericht----- Van: spr...@li... [mailto:spr...@li...] Namens Kopylenko, Dmitry Verzonden: Wednesday, October 01, 2003 1:46 PM Aan: 'Rod Johnson'; 'Colin Sampaleanu'; 'jue...@we...' CC: 'Spring Developers' Onderwerp: RE: [Springframework-developer] Any sort of defined policy w/regards to tab/space usage and indentation? I also use tabs and Eclipse supports them very well ;-) Dmitriy. -----Original Message----- From: Rod Johnson [mailto:rod...@in...] Sent: Wednesday, October 01, 2003 3:37 AM To: Colin Sampaleanu; jue...@we... Cc: Spring Developers Subject: Re: [Springframework-developer] Any sort of defined policy w/regards to tab/space usage and indentation? The use of tabs is historical. I'm in the minority of people who use tabs, so the original code base had tabs and I still use them. I know most people in open source projects hate tabs, so we might eventually need to change this. We did consider the use of Jalopy before check in at one point. I'd prefer not to mess with the formatting process before 1.0 unless we really need to. Regards, Rod ----- Original Message ----- From: "Colin Sampaleanu" <col...@ex...> To: <rod...@in...>; <jue...@we...> Cc: "Spring Developers" <spr...@li...> Sent: Tuesday, September 30, 2003 10:14 PM Subject: [Springframework-developer] Any sort of defined policy w/regards to tab/space usage and indentation? > I notice that most of the codebase in Spring uses hard tabs as opposed > to spaces for indentation. From looking at some comment text which > does have some embedded spaces, as far as I can tell the assumption is > that tabs equate to 4 chars, although most of the code itself does not > seem to make this assumption? > > Is there any sort of project policy or guideline on this? i.e. > something like 'all code must use hard tabs, and align elements only > with tabs', etc.? I can hopefully work with any policy, but I'd just > like to know if one exists... (although if I am forced to use hard > tabs I would actually have to set up another Eclipse workspace, right > now my tab key puts out spaces). > > fwiw, I have personally found that hard tabs are somewhat of a > disaster (or at least a problem) in many team environents. In my > teams, it's generally the one rule we apply with no exceptions, "no > hard tabs". The problem is that while hard tabs have the ideal benefit > of allowing users to indent to whatever size they like, in practice > people seem to not have the discipline to stick to using tabs only, or > their editor of the moment doesn't allow them to set the tab size to > something else easilly, so spaces creep in. Once that happens to any > extent, the code looks broken to anybody else using another tab size. > > Regards, > Colin > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |