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: Lars F. <lar...@gm...> - 2003-08-21 17:52:43
|
Finally I've wasted to much time trying to get Spring work with Hibernate without an example about configuration. Never had so many problems using a framework despite the fact that this one is better documented than most of the rest. Documentation is just too abstract at the moment to help with real world problems. I just can't get Spring to map my *.hbm.xml file defined under 'mappingResources'. Even worse I don't get any kind of useful error message. Maybe this is a BEA problem with reading configuration inside of the war, maybe not. Maybe I'll continue if there's a working example with Hibernate (all I would need is a COMPLETE configuration example). IMO the skeletons are not very useful. On the other hand I don't want to wait until October so I'll take a look at WebWork2. I could solve all my problems with WebWork 1 myself without documentation. Thanks a lot for helping me in the past. Lars |
|
From: <jue...@we...> - 2003-08-21 17:25:40
|
Hi everybody,
I've introduced a proxy factory bean for simplified declarative =
transaction demarcation, as an alternative to a standard =
ProxyFactoryBean plus TransactionInterceptor combo. The definition =
syntax is as follows:
<bean id=3D"myBusinessService" =
class=3D"org.springframework.transaction.interceptor.TransactionProxyFact=
oryBean">
<property name=3D"transactionManager"><ref =
bean=3D"myTransactionManager"/></property>
<property name=3D"target"><ref =
bean=3D"myBusinessServiceTarget"/></property>
<property name=3D"proxyInterfacesOnly"><value>true</value><property>
<property name=3D"transactionAttributes">
<props>
<prop key=3D"myBusiness*">PROPAGATION_REQUIRED</prop>
<prop key=3D"myBusinessMethod">PROPAGATION_MANDATORY</prop>
</props>
</property>
</bean>
Note that the transaction attributes are specified as properties here, =
with the method name as key. No need for a separate =
TransactionInterceptor bean that defines the attributes for all proxies =
in the application context, with the need for fully qualified class plus =
method names.
The advantages, as I see them, are:
- The transaction attributes for the methods of a target are defined in =
the proxy for the target. That keeps related things close together.
- The target can be specified as bean reference, no need to care about a =
chain of interceptor names. A bean reference is an easier, i.e. better =
known, concept.
- The proxy interfaces are determined automatically from the target. =
proxyInterfacesOnly=3Dtrue is the default, setting it to false will =
create a CGLIB proxy.
- All things considered, it covers the typical use case of declarative =
transactions.
The disadvantage is, of course, the loss of configuration options - that =
can be an advantage too, as it makes the whole issue less complex. =
Anyway, for full control like including arbitrary interceptors, proxying =
specific interfaces, etc, the standard ProxyFactoryBean has to be used.
BTW, notice the "*" mapping for method names. This is available with =
both TransactionInterceptor and TransactionProxyFactoryBean: It's a =
simple way of applying an attribute to a set of methods. The more =
specific definition will win, so myBusinessMethod will have "mandatory" =
but myBusinessSomething and myBusinessWhatever will have "required". In =
case of overloaded methods, all methods that match the given name will =
be registered. There is no support for addressing a specific overloaded =
method yet.
Juergen
DI J=FCrgen H=F6ller
Senior System Architect
______________________________________
werk3ATS - division systementwicklung
part of werk3AT internetmedien oeg
europaplatz 4
A - 4020 linz
t. +43 (0) 732 71 65 29 502
f. +43 (0) 732 71 65 29 3
mailto:jue...@we...
http://www.werk3at.com
______________________________________
werk3ATS - WIR ENTWICKELN ERFOLG
|
|
From: <jue...@we...> - 2003-08-21 09:58:18
|
Just fixed :-)
-----Original Message-----
From: j=FCrgen h=F6ller [werk3AT]=20
Sent: Wednesday, August 20, 2003 5:55 PM
To: jp....@ti...
Cc: springframework-developer
Subject: RE: [Springframework-developer] Tags
This is indeed a bug. It's caused by the nesting of BeanWrapperImpl, as =
far as I see: A nested BeanWrapperImpl registers the type mismatch for =
*its* property, without nested path. Unfortunately I don't have any more =
time today, so I'll look into this tomorrow morning.
Juergen
-----Original Message-----
From: jp....@ti... [mailto:jp....@ti...]
Sent: Wednesday, August 20, 2003 5:31 PM
To: j=FCrgen h=F6ller [werk3AT]
Cc: springframework-developer
Subject: RE: [Springframework-developer] Tags
Juergen,
I guess I found a bug. My issue seems due to the use of embedded =
objects. The log tell only about the final object name and not the =
entire path.
This is my field Jsp part:
<p>
<spring:bind path=3D"command.search.referral.date">
<span class=3D"error"><c:out =
value=3D"${status.errorMessage}"/></span>
<p class=3D"label"><fmt:message key=3D"champ.date"/></p>
<input type=3D"text" size=3D"12" maxlength=3D"12" =
name=3D"search.referral.date" value=3D"<c:out =
value=3D"${status.value}"/>">
</spring:bind>
</p>
The log for an invalid input is:
2003-08-20 18:24:34,234 INFO [org.sis.sirene.web.CallingoutController] =
hasErrors
2003-08-20 18:24:34,234 INFO [org.sis.sirene.web.CallingoutController] =
Error: command, org.springframework.validation.FieldError, typeMismatch, =
Failed to convert property value of type [java.lang.String] to required =
type [java.util.Date] for property named [date]; nested exception is:=20
java.lang.IllegalArgumentException: Could not parse date: Unparseable =
date: "20.12.00"
The code that produced the log is:
logger.info("hasErrors");
List lerrors =3D errors.getAllErrors();
Iterator it =3D lerrors.iterator();
while(it.hasNext()) {
ObjectError e =3D (ObjectError)it.next();
logger.info("Error: " + e.getObjectName() + ", " + =
e.getClass().getName() + ", " + e.getCode() + ", " + =
e.getDefaultMessage());
}
But still, I suppose the status.value and status.errorMessage in case or =
such an error are bound to 'date' instead of 'search.referral.date'. =
That is why I have nothing returned.
Jean-Pierre
---------- Initial Header -----------
From : j=FCrgen h=F6ller [werk3AT] <jue...@we...>
To : =
<jp....@ti...>,<spr...@li...>
Cc :=20
Date : Wed, 20 Aug 2003 16:58:42 +0200
Subject : RE: [Springframework-developer] Tags
Jean-Pierre,
You should see a "typeMismatch" error in case of such malformed values. =
If you use status.value, you should see the malformed string again. And =
if you define a message for code "typeMismatch" or =
"typeMismatch.{fieldName}" or "typeMismatch.{objectName}.{fieldName}" =
(see FieldError javadoc) in the message source, you should see a proper =
error message too.
I've just tried on my installation, it still works ;-)
Juergen
-----Original Message-----
From: jp....@ti... [mailto:jp....@ti...]
Sent: Wednesday, August 20, 2003 4:40 PM
To: spr...@li...
Subject: [Springframework-developer] Tags
Hi,
I have a basic problem with the form validation. Ok for rejectValue from =
a validator, but how to handle Mismatch errors from the binder itself?=20
Assume using a date field that is malformed by the user. The editor will =
not be able to parse the date. Currently I come back to the form page as =
expected. But:
1) The malformed data is lost. The field is empty.
2) The status.errorMessage is void also.
How not loose the initial input and how be able to write an error =
message to the user?
Sorry for a so basic question, but if I cannot find the solution, it =
will be worse for new users.
Jean-Pierre
********** L'ADSL A 20 EUR/MOIS**********
Tiscali propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le =
modem ADSL offert !=20
Pour profiter de cette offre exceptionnelle, cliquez ici : =
http://register.tiscali.fr/adsl/
Offre soumise =E0 conditions.
-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
********** L'ADSL A 20 EUR/MOIS**********
Tiscali propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le =
modem ADSL offert !=20
Pour profiter de cette offre exceptionnelle, cliquez ici : =
http://register.tiscali.fr/adsl/
Offre soumise =E0 conditions.
-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: JP P. <jp....@ti...> - 2003-08-20 19:38:55
|
>> P.s. any comments on code, tests or whatever are appreciated... Alef, In the time I used Struts I was a Tiles fan. It's a good thing to enable its use in Spring, but I consider it not so dramatically useful as in Struts. The Spring views definition allows a behaviour close to Tiles although not completely so rich and with one indirection level less. I am just a little frustrated since individual "attributesCSV" properties cannot longer be redefined in "child" views. This was possible until a month ago. With this feature we were very close to Tiles. Take a look at the "Countries" demo. You will see a construction letting see a "Tiles like" approach. In summary, my thought is: - For small and middle layout complexity, the original possibilities of Spring are largely sufficient. - For complex layouts and large applications, Tiles adds managing possibilities. - The value of Tiles is not as great as in Struts, due to the better views handling. But don't think it's no worth ;-). Finally, adding Tiles improves the Spring scalability. Regards, Jean-Pierre |
|
From: Jean-Pierre <jp...@jp...> - 2003-08-20 17:45:27
|
Looked at code, it seems it's done this way. Better, the whole collection of Exceptions is thrown. So normally, all the bounds are currently done. Jean-Pierre -----Message d'origine----- De=A0: spr...@li... [mailto:spr...@li...] De la part de jp....@ti... Envoy=E9=A0: mercredi 20 ao=FBt 2003 18:14 =C0=A0: kk Cc=A0: juergen.hoeller; springframework-developer Objet=A0: [Springframework-developer] Re: [Springframework-developer] = Tags Ken, You highlight a second issue (remainings bindings). The first was due in my case as you could see by the use of nested properties. The best way for this second issue would be, I think, to rewrite the BeanWrapperImpl in order to catch and store exceptions during the binding and then rethrow the first one when all bindings are done. Jean-Pierre ---------- Initial Header ----------- From : Ken Krebs <kk...@kk...> To : "jp....@ti..." <jp....@ti...> Cc : "j=FCrgen h=F6ller = [werk3AT]"<jue...@we...>, 'spring-dev-list' <spr...@li...> Date : Wed, 20 Aug 2003 10:43:29 -0500 Subject : Re: [Springframework-developer] Tags JP, Petclinic shows an example of this on the add/edit Pet forms and the=20 addVisit form. Look at the messages.properties for the typeMismatch=20 messages. I got a reply from Juergen when I queried about this situation (sent on=20 17-JUN). See my original message and the reply below. As to keeping the data intact, your FormController should set the=20 sessionForm property to true. In petclinic, this is done in the=20 constructor. The date editor is setup in AbstractClinicForm.initBinder(). There is a problem with this technique in that this process will retain=20 the bad date data that was entered but not other subsequent data on the=20 form as it seems to short circuit the rest of the binding process. Try=20 entering something in the Description field on the addVisit form. Then=20 enter a bad date, submit and see what happens. Perhaps I'm not doing it=20 quite right ?? Initially, I tried to work around the ugly stacktrace message I was=20 getting by creating my own date editor and trapping the ParseException=20 and setting the field to null, thereby handing it off to the validator.=20 Ideally, it would be nice if the custom editor would participate in the=20 same way as validators do, IMO. Regards, Ken |
|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-08-20 16:43:51
|
Ken,=0D=0A=0D=0AYou highlight a second issue (remainings bindings). The f=
irst was due in my case as you could see by the use of nested properties.=
=0D=0AThe best way for this second issue would be, I think, to rewrite th=
e BeanWrapperImpl in order to catch and store exceptions during the bindi=
ng and then rethrow the first one when all bindings are done.=0D=0A=0D=0A=
Jean-Pierre=0D=0A=0D=0A---------- Initial Header -----------=0D=0A=0D=0AF=
rom : Ken Krebs <kk...@kk...>=0D=0ATo : "jp.pawlak@tiscali=
.fr" <jp....@ti...>=0D=0ACc : "j=FCrgen h=F6ller [werk3A=
T]"<jue...@we...>, 'spring-dev-list' <springframework-deve=
lo...@li...>=0D=0ADate : Wed, 20 Aug 2003 10:43:29 -=
0500=0D=0ASubject : Re: [Springframework-developer] Tags=0D=0A=0D=0AJP,=0D=
=0A=0D=0APetclinic shows an example of this on the add/edit Pet forms and=
the =0D=0AaddVisit form. Look at the messages.properties for the typeMis=
match =0D=0Amessages.=0D=0A=0D=0AI got a reply from Juergen when I querie=
d about this situation (sent on =0D=0A17-JUN). See my original message an=
d the reply below.=0D=0A=0D=0AAs to keeping the data intact, your FormCon=
troller should set the =0D=0AsessionForm property to true. In petclinic, =
this is done in the =0D=0Aconstructor. The date editor is setup in Abstra=
ctClinicForm.initBinder().=0D=0A=0D=0AThere is a problem with this techni=
que in that this process will retain =0D=0Athe bad date data that was ent=
ered but not other subsequent data on the =0D=0Aform as it seems to short=
circuit the rest of the binding process. Try =0D=0Aentering something in=
the Description field on the addVisit form. Then =0D=0Aenter a bad date,=
submit and see what happens. Perhaps I'm not doing it =0D=0Aquite right =
??=0D=0A=0D=0AInitially, I tried to work around the ugly stacktrace messa=
ge I was =0D=0Agetting by creating my own date editor and trapping the Pa=
rseException =0D=0Aand setting the field to null, thereby handing it off =
to the validator. =0D=0AIdeally, it would be nice if the custom editor wo=
uld participate in the =0D=0Asame way as validators do, IMO.=0D=0A=0D=0AR=
egards,=0D=...@ti... wrote:=0D=0A=0D=0A=
>Hi,=0D=0A>I have a basic problem with the form validation. Ok for reject=
Value from a validator, but how to handle Mismatch errors from the binder=
itself? =0D=0A>Assume using a date field that is malformed by the user. =
The editor will not be able to parse the date. Currently I come back to t=
he form page as expected. But:=0D=0A>1) The malformed data is lost. The f=
ield is empty.=0D=0A>2) The status.errorMessage is void also.=0D=0A>=0D=0A=
>How not loose the initial input and how be able to write an error messag=
e to the user?=0D=0A>=0D=0A>Sorry for a so basic question, but if I canno=
t find the solution, it will be worse for new users.=0D=0A>=0D=0A>Jean-Pi=
erre=0D=0A>=0D=0A>=0D=0A> =0D=0A>=0D=0A=0D=0A=0D=0A=0D=0AJuergen's reply=
:=0D=0A=0D=0A> =0D=0A>=0D=0AHi Ken,=0D=0A =0D=0AYou can easily replace t=
he default error message by defining a =0D=0AMessageSource, i.e. a "messa=
ges.properties" bundle or the like. If you =0D=0Adefine a message for the=
key "typeMismatch" there, you'll see that =0D=0Amessage in your form in =
case of an error with code "typeMismatch". You =0D=0Acan even define more=
specific messages like for "typeMismatch.myField" =0D=0Aor even "typeMis=
match.myObject.myField" that will only get used on the =0D=0Aspecified fi=
eld resp. object and field. Of course this works with your =0D=0Aown erro=
r codes that your own validator produces too. See the FieldError =0D=0Aja=
vadoc for details.=0D=0A =0D=0ASo I'd suggest to stick to CustomDateEdito=
r but override the respective =0D=0Amessages. This will both keep the off=
ending entry and provide a =0D=0Alocalized message. Is that what you mean=
t to achieve? If there's =0D=0Aanything left, let's try to extend CustomD=
ateEditor accordingly.=0D=0A =0D=0AJuergen=0D=0A =0D=0A =0D=0A-----Origin=
al Message-----=0D=0A*From:* Ken Krebs [mailto:kk...@kk...]=0D=0A*Sent:*=
Tuesday, June 17, 2003 7:32 PM=0D=0A*To:* j=FCrgen h=F6ller [werk3AT]=0D=
=0A*Cc:* 'spring-dev-list'=0D=0A*Subject:* MVC binding and validation=0D=0A=
=0D=0AJuergen,=0D=0A=0D=0ANOTE: This little problem is not pressing as I =
have an acceptable =0D=0Asolution in place for petclinic which will be po=
sted Real Soon Now ;-) .=0D=0A=0D=0AIn a couple of my petclinic forms, I=
use BaseCommandController's =0D=0AinitBinder method to install a custom =
Date PropertyEditor to handle =0D=0Adates of the form "yyyy-mm-dd". The f=
ramework class CustomDateEditor is =0D=0Anot convenient to subclass so I =
used it's code as a basis for my own =0D=0ASimpleDateEditor (code is show=
n below). In this class's setAsText =0D=0Amethod, I handle the ParseExcep=
tion to set the object to null because I =0D=0Ado not like the error mes=
sage that gets bound in if I let it throw an =0D=0AIllegalArgumentExcepti=
on as does CustomDateEditor. The message looks =0D=0Alike a stack trace a=
nd would be incomprehensible to the average end =0D=0Auser, i.e.: *Failed=
to convert property value of type [java.lang.String] =0D=0Ato required t=
ype [java.util.Date]; nested exception is: =0D=0Ajava.lang.IllegalArgumen=
tException: Could not parse date: Unparseable =0D=0Adate: "2000-06-"*. Th=
is message comes from BeanWrapperImpl's =0D=0AsetPropertyValue throwing a=
TypeMismatchException. Setting the object =0D=0Avalue to null allows the=
problem to be handled by my validator which =0D=0Asimply reports the now=
erased date entry as "invalid". Obviously, this =0D=0Ais not ideal. It w=
ould be better to allow the PropertyEditor to provide =0D=0Aa user-friend=
ly, localizable exception while preserving the offending =0D=0Aentry. Unf=
ortunately, setAsText can't throw any checked Exceptions like =0D=0Athe =
ErrorCodedPropertyVetoException that DataBinder's bind method uses.=0D=0A=
=0D=0AWhat do you think ?=0D=0A=0D=0A=0D=0A=0D=0AKen=0D=0A=0D=0A=0D=0A/*=0D=
=0A * SimpleDateEditor.java=0D=0A *=0D=0A */=0D=0A=0D=0Apackage petclinic=
.validation;=0D=0A=0D=0Aimport java.util.Date;=0D=0Aimport java.beans.Pro=
pertyEditorSupport;=0D=0Aimport java.text.SimpleDateFormat;=0D=0Aimport j=
ava.text.ParseException;=0D=0A=0D=0A/**=0D=0A *=0D=0A * @author Ken Kre=
bs=0D=0A */=0D=0Apublic class SimpleDateEditor extends PropertyEditorSupp=
ort {=0D=0A =0D=0A private SimpleDateFormat dateFormat;=0D=0A =0D=0A=
/** Creates a new instance of SimpleDateEditor */=0D=0A public Sim=
pleDateEditor() {=0D=0A dateFormat =3D new SimpleDateFormat("yyyy-=
MM-dd");=0D=0A dateFormat.setLenient(false);=0D=0A }=0D=0A =0D=
=0A /**=0D=0A * Parse the Date from the given text, using the spe=
cified DateFormat.=0D=0A * Trap a ParseException to allow the Valida=
tor to handle it.=0D=0A */=0D=0A public void setAsText(String text=
) {=0D=0A try {=0D=0A setValue(this.dateFormat.parse(te=
xt));=0D=0A } catch (ParseException ex) {=0D=0A // t=
hrow new IllegalArgumentException("Could not parse =0D=0Adate: " + ex.get=
Message());=0D=0A setValue(null);=0D=0A }=0D=0A }=0D=
=0A =0D=0A /**=0D=0A * Format the Date as String, using the spec=
ified DateFormat.=0D=0A */=0D=0A public String getAsText() {=0D=0A=
return this.dateFormat.format((Date) getValue());=0D=0A }=0D=0A=
=0D=0A}=0D=0A=0A=0A********** L'ADSL A 20 EUR/MOIS**********=0ATiscali=
propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le modem ADSL =
offert ! =0APour profiter de cette offre exceptionnelle, cliquez ici : ht=
tp://register.tiscali.fr/adsl/=0AOffre soumise =E0 conditions.=0A
|
|
From: Ken K. <kk...@kk...> - 2003-08-20 16:38:00
|
JP,
Petclinic shows an example of this on the add/edit Pet forms and the
addVisit form. Look at the messages.properties for the typeMismatch
messages.
I got a reply from Juergen when I queried about this situation (sent on
17-JUN). See my original message and the reply below.
As to keeping the data intact, your FormController should set the
sessionForm property to true. In petclinic, this is done in the
constructor. The date editor is setup in AbstractClinicForm.initBinder().
There is a problem with this technique in that this process will retain
the bad date data that was entered but not other subsequent data on the
form as it seems to short circuit the rest of the binding process. Try
entering something in the Description field on the addVisit form. Then
enter a bad date, submit and see what happens. Perhaps I'm not doing it
quite right ??
Initially, I tried to work around the ugly stacktrace message I was
getting by creating my own date editor and trapping the ParseException
and setting the field to null, thereby handing it off to the validator.
Ideally, it would be nice if the custom editor would participate in the
same way as validators do, IMO.
Regards,
Ken
jp....@ti... wrote:
>Hi,
>I have a basic problem with the form validation. Ok for rejectValue from a validator, but how to handle Mismatch errors from the binder itself?
>Assume using a date field that is malformed by the user. The editor will not be able to parse the date. Currently I come back to the form page as expected. But:
>1) The malformed data is lost. The field is empty.
>2) The status.errorMessage is void also.
>
>How not loose the initial input and how be able to write an error message to the user?
>
>Sorry for a so basic question, but if I cannot find the solution, it will be worse for new users.
>
>Jean-Pierre
>
>
>
>
Juergen's reply:
>
>
Hi Ken,
You can easily replace the default error message by defining a
MessageSource, i.e. a "messages.properties" bundle or the like. If you
define a message for the key "typeMismatch" there, you'll see that
message in your form in case of an error with code "typeMismatch". You
can even define more specific messages like for "typeMismatch.myField"
or even "typeMismatch.myObject.myField" that will only get used on the
specified field resp. object and field. Of course this works with your
own error codes that your own validator produces too. See the FieldError
javadoc for details.
So I'd suggest to stick to CustomDateEditor but override the respective
messages. This will both keep the offending entry and provide a
localized message. Is that what you meant to achieve? If there's
anything left, let's try to extend CustomDateEditor accordingly.
Juergen
-----Original Message-----
*From:* Ken Krebs [mailto:kk...@kk...]
*Sent:* Tuesday, June 17, 2003 7:32 PM
*To:* jürgen höller [werk3AT]
*Cc:* 'spring-dev-list'
*Subject:* MVC binding and validation
Juergen,
NOTE: This little problem is not pressing as I have an acceptable
solution in place for petclinic which will be posted Real Soon Now ;-) .
In a couple of my petclinic forms, I use BaseCommandController's
initBinder method to install a custom Date PropertyEditor to handle
dates of the form "yyyy-mm-dd". The framework class CustomDateEditor is
not convenient to subclass so I used it's code as a basis for my own
SimpleDateEditor (code is shown below). In this class's setAsText
method, I handle the ParseException to set the object to null because I
do not like the error message that gets bound in if I let it throw an
IllegalArgumentException as does CustomDateEditor. The message looks
like a stack trace and would be incomprehensible to the average end
user, i.e.: *Failed to convert property value of type [java.lang.String]
to required type [java.util.Date]; nested exception is:
java.lang.IllegalArgumentException: Could not parse date: Unparseable
date: "2000-06-"*. This message comes from BeanWrapperImpl's
setPropertyValue throwing a TypeMismatchException. Setting the object
value to null allows the problem to be handled by my validator which
simply reports the now erased date entry as "invalid". Obviously, this
is not ideal. It would be better to allow the PropertyEditor to provide
a user-friendly, localizable exception while preserving the offending
entry. Unfortunately, setAsText can't throw any checked Exceptions like
the ErrorCodedPropertyVetoException that DataBinder's bind method uses.
What do you think ?
Ken
/*
* SimpleDateEditor.java
*
*/
package petclinic.validation;
import java.util.Date;
import java.beans.PropertyEditorSupport;
import java.text.SimpleDateFormat;
import java.text.ParseException;
/**
*
* @author Ken Krebs
*/
public class SimpleDateEditor extends PropertyEditorSupport {
private SimpleDateFormat dateFormat;
/** Creates a new instance of SimpleDateEditor */
public SimpleDateEditor() {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
}
/**
* Parse the Date from the given text, using the specified DateFormat.
* Trap a ParseException to allow the Validator to handle it.
*/
public void setAsText(String text) {
try {
setValue(this.dateFormat.parse(text));
} catch (ParseException ex) {
// throw new IllegalArgumentException("Could not parse
date: " + ex.getMessage());
setValue(null);
}
}
/**
* Format the Date as String, using the specified DateFormat.
*/
public String getAsText() {
return this.dateFormat.format((Date) getValue());
}
}
|
|
From: <jue...@we...> - 2003-08-20 16:08:20
|
This is indeed a bug. It's caused by the nesting of BeanWrapperImpl, as =
far as I see: A nested BeanWrapperImpl registers the type mismatch for =
*its* property, without nested path. Unfortunately I don't have any more =
time today, so I'll look into this tomorrow morning.
Juergen
-----Original Message-----
From: jp....@ti... [mailto:jp....@ti...]
Sent: Wednesday, August 20, 2003 5:31 PM
To: j=FCrgen h=F6ller [werk3AT]
Cc: springframework-developer
Subject: RE: [Springframework-developer] Tags
Juergen,
I guess I found a bug. My issue seems due to the use of embedded =
objects. The log tell only about the final object name and not the =
entire path.
This is my field Jsp part:
<p>
<spring:bind path=3D"command.search.referral.date">
<span class=3D"error"><c:out =
value=3D"${status.errorMessage}"/></span>
<p class=3D"label"><fmt:message key=3D"champ.date"/></p>
<input type=3D"text" size=3D"12" maxlength=3D"12" =
name=3D"search.referral.date" value=3D"<c:out =
value=3D"${status.value}"/>">
</spring:bind>
</p>
The log for an invalid input is:
2003-08-20 18:24:34,234 INFO [org.sis.sirene.web.CallingoutController] =
hasErrors
2003-08-20 18:24:34,234 INFO [org.sis.sirene.web.CallingoutController] =
Error: command, org.springframework.validation.FieldError, typeMismatch, =
Failed to convert property value of type [java.lang.String] to required =
type [java.util.Date] for property named [date]; nested exception is:=20
java.lang.IllegalArgumentException: Could not parse date: Unparseable =
date: "20.12.00"
The code that produced the log is:
logger.info("hasErrors");
List lerrors =3D errors.getAllErrors();
Iterator it =3D lerrors.iterator();
while(it.hasNext()) {
ObjectError e =3D (ObjectError)it.next();
logger.info("Error: " + e.getObjectName() + ", " + =
e.getClass().getName() + ", " + e.getCode() + ", " + =
e.getDefaultMessage());
}
But still, I suppose the status.value and status.errorMessage in case or =
such an error are bound to 'date' instead of 'search.referral.date'. =
That is why I have nothing returned.
Jean-Pierre
---------- Initial Header -----------
From : j=FCrgen h=F6ller [werk3AT] <jue...@we...>
To : =
<jp....@ti...>,<spr...@li...>
Cc :=20
Date : Wed, 20 Aug 2003 16:58:42 +0200
Subject : RE: [Springframework-developer] Tags
Jean-Pierre,
You should see a "typeMismatch" error in case of such malformed values. =
If you use status.value, you should see the malformed string again. And =
if you define a message for code "typeMismatch" or =
"typeMismatch.{fieldName}" or "typeMismatch.{objectName}.{fieldName}" =
(see FieldError javadoc) in the message source, you should see a proper =
error message too.
I've just tried on my installation, it still works ;-)
Juergen
-----Original Message-----
From: jp....@ti... [mailto:jp....@ti...]
Sent: Wednesday, August 20, 2003 4:40 PM
To: spr...@li...
Subject: [Springframework-developer] Tags
Hi,
I have a basic problem with the form validation. Ok for rejectValue from =
a validator, but how to handle Mismatch errors from the binder itself?=20
Assume using a date field that is malformed by the user. The editor will =
not be able to parse the date. Currently I come back to the form page as =
expected. But:
1) The malformed data is lost. The field is empty.
2) The status.errorMessage is void also.
How not loose the initial input and how be able to write an error =
message to the user?
Sorry for a so basic question, but if I cannot find the solution, it =
will be worse for new users.
Jean-Pierre
********** L'ADSL A 20 EUR/MOIS**********
Tiscali propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le =
modem ADSL offert !=20
Pour profiter de cette offre exceptionnelle, cliquez ici : =
http://register.tiscali.fr/adsl/
Offre soumise =E0 conditions.
-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
********** L'ADSL A 20 EUR/MOIS**********
Tiscali propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le =
modem ADSL offert !=20
Pour profiter de cette offre exceptionnelle, cliquez ici : =
http://register.tiscali.fr/adsl/
Offre soumise =E0 conditions.
|
|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-08-20 15:43:15
|
Juergen,=0D=0A=0D=0AI guess I found a bug. My issue seems due to the use =
of embedded objects. The log tell only about the final object name and no=
t the entire path.=0D=0A=0D=0AThis is my field Jsp part:=0D=0A<p>=0D=0A =
<spring:bind path=3D"command.search.referral.date">=0D=0A <span class=3D=
"error"><c:out value=3D"${status.errorMessage}"/></span>=0D=0A <p class=3D=
"label"><fmt:message key=3D"champ.date"/></p>=0D=0A <input type=3D"text" =
size=3D"12" maxlength=3D"12" name=3D"search.referral.date" value=3D"<c:ou=
t value=3D"${status.value}"/>">=0D=0A </spring:bind>=0D=0A</p>=0D=0A=0D=0A=
The log for an invalid input is:=0D=0A2003-08-20 18:24:34,234 INFO [org.=
sis.sirene.web.CallingoutController] hasErrors=0D=0A2003-08-20 18:24:34,2=
34 INFO [org.sis.sirene.web.CallingoutController] Error: command, org.sp=
ringframework.validation.FieldError, typeMismatch, Failed to convert prop=
erty value of type [java.lang.String] to required type [java.util.Date] f=
or property named [date]; nested exception is: =0D=0A java.lang.IllegalAr=
gumentException: Could not parse date: Unparseable date: "20.12.00"=0D=0A=
=0D=0AThe code that produced the log is:=0D=0Alogger.info("hasErrors");=0D=
=0AList lerrors =3D errors.getAllErrors();=0D=0AIterator it =3D lerrors.i=
terator();=0D=0Awhile(it.hasNext()) {=0D=0A ObjectError e =3D (ObjectErro=
r)it.next();=0D=0A logger.info("Error: " + e.getObjectName() + ", " + e.g=
etClass().getName() + ", " + e.getCode() + ", " + e.getDefaultMessage());=
=0D=0A}=0D=0A=0D=0ABut still, I suppose the status.value and status.error=
Message in case or such an error are bound to 'date' instead of 'search.r=
eferral.date'. That is why I have nothing returned.=0D=0A=0D=0AJean-Pierr=
e=0D=0A=0D=0A=0D=0A---------- Initial Header -----------=0D=0A=0D=0AFrom =
: j=FCrgen h=F6ller [werk3AT] <jue...@we...>=0D=0ATo =
: <jp....@ti...>,<spr...@li...=
forge.net>=0D=0ACc : =0D=0ADate : Wed, 20 Aug 2003 16:58:42=
+0200=0D=0ASubject : RE: [Springframework-developer] Tags=0D=0A=0D=0AJea=
n-Pierre,=0D=0A=0D=0AYou should see a "typeMismatch" error in case of suc=
h malformed values. If you use status.value, you should see the malformed=
string again. And if you define a message for code "typeMismatch" or "ty=
peMismatch.{fieldName}" or "typeMismatch.{objectName}.{fieldName}" (see F=
ieldError javadoc) in the message source, you should see a proper error m=
essage too.=0D=0A=0D=0AI've just tried on my installation, it still works=
;-)=0D=0A=0D=0AJuergen=0D=0A=0D=0A=0D=0A-----Original Message-----=0D=0A=
From: jp....@ti... [mailto:jp....@ti...]=0D=0ASent: Wedne=
sday, August 20, 2003 4:40 PM=0D=0ATo: spr...@li...=
urceforge.net=0D=0ASubject: [Springframework-developer] Tags=0D=0A=0D=0A=0D=
=0AHi,=0D=0AI have a basic problem with the form validation. Ok for rejec=
tValue from a validator, but how to handle Mismatch errors from the binde=
r itself? =0D=0AAssume using a date field that is malformed by the user. =
The editor will not be able to parse the date. Currently I come back to t=
he form page as expected. But:=0D=0A1) The malformed data is lost. The fi=
eld is empty.=0D=0A2) The status.errorMessage is void also.=0D=0A=0D=0AHo=
w not loose the initial input and how be able to write an error message t=
o the user?=0D=0A=0D=0ASorry for a so basic question, but if I cannot fin=
d the solution, it will be worse for new users.=0D=0A=0D=0AJean-Pierre=0D=
=0A=0D=0A=0D=0A********** L'ADSL A 20 EUR/MOIS**********=0D=0ATiscali pro=
pose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le modem ADSL offe=
rt ! =0D=0APour profiter de cette offre exceptionnelle, cliquez ici : htt=
p://register.tiscali.fr/adsl/=0D=0AOffre soumise =E0 conditions.=0D=0A=0D=
=0A=0D=0A=0D=0A=0D=0A----------------------------------------------------=
---=0D=0AThis SF.net email is sponsored by Dice.com.=0D=0ADid you know th=
at Dice has over 25,000 tech jobs available today? From=0D=0Acareers in I=
T to Engineering to Tech Sales, Dice has tech jobs from the=0D=0Abest hir=
ing companies. http://www.dice.com/index.epl?rel_code=104=0D=0A__________=
_____________________________________=0D=0ASpringframework-developer mail=
ing lis...@li...=0D=0Ahttps:=
//lists.sourceforge.net/lists/listinfo/springframework-developer=0D=0A=0A=
=0A********** L'ADSL A 20 EUR/MOIS**********=0ATiscali propose l'ADSL le =
moins cher du march=E9 : 20 EUR/mois et le modem ADSL offert ! =0APour pr=
ofiter de cette offre exceptionnelle, cliquez ici : http://register.tisca=
li.fr/adsl/=0AOffre soumise =E0 conditions.=0A
|
|
From: <jue...@we...> - 2003-08-20 15:16:02
|
Jean-Pierre,
You should see a "typeMismatch" error in case of such malformed values. =
If you use status.value, you should see the malformed string again. And =
if you define a message for code "typeMismatch" or =
"typeMismatch.{fieldName}" or "typeMismatch.{objectName}.{fieldName}" =
(see FieldError javadoc) in the message source, you should see a proper =
error message too.
I've just tried on my installation, it still works ;-)
Juergen
-----Original Message-----
From: jp....@ti... [mailto:jp....@ti...]
Sent: Wednesday, August 20, 2003 4:40 PM
To: spr...@li...
Subject: [Springframework-developer] Tags
Hi,
I have a basic problem with the form validation. Ok for rejectValue from =
a validator, but how to handle Mismatch errors from the binder itself?=20
Assume using a date field that is malformed by the user. The editor will =
not be able to parse the date. Currently I come back to the form page as =
expected. But:
1) The malformed data is lost. The field is empty.
2) The status.errorMessage is void also.
How not loose the initial input and how be able to write an error =
message to the user?
Sorry for a so basic question, but if I cannot find the solution, it =
will be worse for new users.
Jean-Pierre
********** L'ADSL A 20 EUR/MOIS**********
Tiscali propose l'ADSL le moins cher du march=E9 : 20 EUR/mois et le =
modem ADSL offert !=20
Pour profiter de cette offre exceptionnelle, cliquez ici : =
http://register.tiscali.fr/adsl/
Offre soumise =E0 conditions.
-------------------------------------------------------
This SF.net email is sponsored by Dice.com.
Did you know that Dice has over 25,000 tech jobs available today? From
careers in IT to Engineering to Tech Sales, Dice has tech jobs from the
best hiring companies. http://www.dice.com/index.epl?rel_code=104
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: =?iso-8859-1?Q?<jp....@ti...> - 2003-08-20 14:45:03
|
Hi,=0D=0AI have a basic problem with the form validation. Ok for rejectVa= lue from a validator, but how to handle Mismatch errors from the binder i= tself? =0D=0AAssume using a date field that is malformed by the user. The= editor will not be able to parse the date. Currently I come back to the = form page as expected. But:=0D=0A1) The malformed data is lost. The field= is empty.=0D=0A2) The status.errorMessage is void also.=0D=0A=0D=0AHow n= ot loose the initial input and how be able to write an error message to t= he user?=0D=0A=0D=0ASorry for a so basic question, but if I cannot find t= he solution, it will be worse for new users.=0D=0A=0D=0AJean-Pierre=0D=0A= =0A=0A********** L'ADSL A 20 EUR/MOIS**********=0ATiscali propose l'ADSL = le moins cher du march=E9 : 20 EUR/mois et le modem ADSL offert ! =0APour= profiter de cette offre exceptionnelle, cliquez ici : http://register.ti= scali.fr/adsl/=0AOffre soumise =E0 conditions.=0A |
|
From: Luke T. <ne...@fr...> - 2003-08-20 13:59:00
|
Alef Arendsen (JTeam) wrote: > I don't have a Maven build system installed here, how to handle missing > dependencies for tiles? Or would somebody be so kind to just add them > ;-). > Don't worry about it too much - I don't think anyone's using it anyway :). The dependencies are just added to the project.xml file (it's easy enough to work out the syntax). I've also written a bit about it in the wiki: http://www.springframework.org/wiki/jsp/Wiki?MavenBuild I think the jars you need should already be in the ibiblio repository (struts is definately there), so once you add entries for them to the project.xml file, they should be downloaded automatically. I will have a look later today and make sure the build is still functioning with Maven. Luke. -- Luke Taylor. Monkey Machine Ltd. PGP Key ID: 0x57E9523C http://www.monkeymachine.ltd.uk |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-08-20 12:20:13
|
I don't have a Maven build system installed here, how to handle missing dependencies for tiles? Or would somebody be so kind to just add them ;-). Also, do people (if dependencies are added) just ammend them to the .classpath file and commit it (or is this responsibiliy of the eclipse-users) Alef -----Oorspronkelijk bericht----- Van: Alef Arendsen (JTeam) [mailto:al...@jt...] Verzonden: Wednesday, August 20, 2003 12:20 PM Aan: 'spr...@li...' Onderwerp: Tiles in the CVS I've been adding the TilesView and TilesConfigurer to the CVS just now... Using those you can use Tiles in combination with Spring. * In the docs/tiles directory a small (to be extended a bit more) document can be found describing how to use the Configurer. * In the lib/tiles directory the dependencies have been placed * In the springframework/web/servlet/view/tiles I've placed the sourcefiles * Test coverage isn't up to standards yet (33%). Do people have suggestions for testing rendering of views in general??? What do people think about the internationalization issue? Should we add SpringDefinitionsFactory (as suggested by Tarjei) as well as shall we just include this in an example or something. I kind of don't like the idea of adding extensions to Tiles classes to the Spring codebase... Any opinions? Alef P.s. any comments on code, tests or whatever are appreciated... |
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-08-20 11:56:33
|
Juergen,
Ok, there we go...
There are three use cases.
*** Security
Suppose I want to be able to hide or show certain fields in a form based =
on credentials of a user. Using a handlerinterceptor I will be able to =
inspect the beans for the view and construct information for the view to =
do or do not render certain fields. However, I have to retrieve the =
information while rendering the view. Using the spring:bind tag I can =
retrieve information about what field I'm rendering, but then I still =
have to retrieve the security information for this specific field. The =
ServletRequestDataBinder (SRDB) has all information about the object it =
is created for and would then also be the place to implement security in =
my opinion (at least, in an extending class). Since the SRDB is also =
reachable from the spring:bind tag (and also from inside nested tags) I =
would create a tag retrieving the Errors object (=3D SRDB) which in this =
case also can also generate security information about the field I have =
to render (or not)... I don't want to have the information embedded in =
my model, since I don't consider it to be model-information (just as =
validation information isn't).
*** ListDataBinder
Suppose I want render a List of command objects, instead of a single =
object and still be able to use the spring:bind things. Right now, I've =
got a ListDataBinder (extending ServletRequestDataBinder) that =
implements Collection in order to be able to iterate through it in the =
view. In JSPs this enables me to render a list of object using the =
spring:bind tag (see code snippet 1).
*** DataBinder using different formats
One of our (web)interfaces uses XML at the client side to retrieve and =
post data. The XML has to be transformed to objects, just as would have =
to be done when using request params. However, I want to do this using a =
SRDB as well, to make things more consistent. Specifying which =
databinder to use would be very handy here...
I know, it's all quite complicated behavior, but it's very handy...
If you're interested but not convinced I can go more into detail...
I can imagine something like codesnippet 2 for realizing the behavior.
Alef
******** SNIPPET 1
<%-- render the names of all Accounts contained by the items var =
--%>
<c:forEach items=3D"${items}" var=3D"item" varStatus=3D"index">
<spring:bind path=3D"Account.name">
<c:out value=3D"${status.value}">
</spring:bind>
</c:forEach>
******** SNIPPET 2
<!-- this is the listController we're using -->
<bean id=3D"accountListController" =
class=3D"jteam.site.web.util.ListController">
<!-- specify databinder using a property, defaults to SRDB -->
<property name=3D"dataBinder">
<value><ref bean=3D"listDataBinder"/>
</property>
<property name=3D"listView">
<value>accountList</value>
</property>
<property name=3D"columns">
<list>
<value>accountNo</value>
<value>companyName</value>
<value>companyAddress.city</value>
</list>
</property>
</bean>
=20
<!-- databinder knowing whether or not to show certain fields for =
the requesting user -->
<bean id=3D"editAccountController" =
class=3D"jteam.site.web.util.EditAccountController">
<property name=3D"dataBinder">
<value><ref bean=3D"securityDatabinder"/>
</property>
<property name=3D"formView">
<value>addAccount</value>
</property>
....
<property name=3D"validator"><ref =
bean=3D"recordValidator"></ref></property>
</bean>
-----Oorspronkelijk bericht-----
Van: spr...@li... =
[mailto:spr...@li...] Namens =
j=C3=BCrgen h=C3=B6ller [werk3AT]
Verzonden: Monday, August 18, 2003 11:05 PM
Aan: al...@jt...; spr...@li...
Onderwerp: Re: [Springframework-developer] Overriding =
ServletRequestDataBinder (WAS: polishing and new features - security =
model??)
Alef,
=20
Just to get the idea: What do you intend to add to =
ServletRequestDataBinder via subclassing? Access control to specific =
fields of command or form beans? I'm not sure if the binder is the right =
place to do such a thing.
=20
For access control at the controller level, you could use a custom =
HandlerInterceptor implementation, to be registered with your =
HandlerMapping. Every request mapped there gets passed to the =
interceptor first then, which is able to abort the handler chain and so =
some custom security failure processing.
=20
I'm curious :-)
=20
Juergen
=20
=20
-----Urspr=C3=BCngliche Nachricht-----=20
Von: Alef Arendsen (JTeam) [mailto:al...@jt...]=20
Gesendet: Mo 18.08.2003 22:42=20
An: spr...@li...=20
Cc:=20
Betreff: [Springframework-developer] Overriding =
ServletRequestDataBinder (WAS: polishing and new features - security =
model??)
=09
=09
Trevor, Juergen,
=09
Well, could not really answer last two weeks because of a holiday...
=09
Anyway, I've been thinking about it and I think you made a good point!
The solution I am implementing will not be intrusive at all, but
specifying how security is to be handled does not sound like a
responsibility for the Srping framework...
=09
However, since I'm still going to implement this, indeed I need to be
able to override to ServletRequestDataBinder (and I can think of other
situations where this might come in handy). Basicaly it's not really
possible right now since the Binder is instantiated in about 4 places =
in
a hardcoded way.
=09
We could do it somewhat similar to the LocaleResolver, but then
implementing a FactoryBean using a predefined name (of course by =
default
the ServletRequestDataBinder will be used)??
=09
Juergen, have you got opinions about this?
=09
Alef
=09
-----Oorspronkelijk bericht-----
Van: spr...@li...
[mailto:spr...@li...] Namens
Trevor Cook
Verzonden: Friday, August 01, 2003 4:37 PM
Aan: spr...@li...
Onderwerp: RE: [Springframework-developer] polishing and new features -
security model??????
=09
=09
I think Security might be too large an issue to be addressed in Spring,
at least without complicating it even further. While you're idea has
promise, there are so many other ways of handling it (such as with db
permissions, handling only in certain layers, creating object
hierarchies with different
methods) that my opinion is we should leave it. Spring's philosophy
(IMO) has been about providing a generic core infrastructure that does
NOT intrude on the business layer, and does not enforce a specific way
of coding (for example the whole JDBC vs EJB vs Hibernate vs JDO is
handled seamlessly from the perspective of the business layer). I =
would
vote against adding the sort of handling you're describing.
=09
That being said, we have run into some of the issues you're discussing
in our programming over the last few months on a Spring-based web-app.
We solved our problem through custom taglibs in the (jsp) web layer
(this handles accessors), and you can use a custom binder (instead of
the default from BindUtils) which receives the request object (so has
access to security
info) before processing each object. I'm not quite up-to-speed on the
current codebase, so Juergen may have a "quick-tip" on how best to
override the binder used. AOP also looks very promising, although I
have yet to get into it.
=09
Basically, Spring provides many ways for you to handle your problem
according to your needs, but I don't think we can generalize the
(security) solution, only the tools (Spring) to deal with it as needed.
=09
My 2 cents.
=09
Trevor D. Cook
=09
=09
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Alef Arendsen (JTeam)
Sent: August 1, 2003 4:24 AM
To: 'Timo Verhoeven'; spr...@li...
Subject: RE: [Springframework-developer] polishing and new features -
security model??????
=09
=09
<quote>
C - [ depends on project ]
B - POJO Business Objects
A - POJO DAO Objects (Hibernate in my case)
=09
Objects in each layer may only call other Object in the same layer or
Objects in the NEXT lower layer.
=09
Given I was to build an EJB solution, layer C would be a SINGLE =
session
=09
facade SLSB (single because I want to avoid COSTLY inter EJB calls).
For testing/QA, I would write unittests at layer C to test B and A, and
=09
maybe unittests at layer D to test the SLSB. For maintenance
(developers only) I could write another POJO java-app running at C. If
I wanted to CHANGE the solution-type from EJB to webinterface I could
either replace the SLSB at C with servlets/jsps/etc. or write a
servlet/jsp/etc. layer at D using EJB layer C. </quote> Well, this =
isn't
very odd! It resembles the way we (and probably a lot Of other people)
do things...
=09
<quote>
The above appears VERY FLEXBILE to me. If I got you right, you would
like to add security at layer A. This would screw up the model at
various points (my problem - I do not have to use those security
features). Furthermore, it might not be a good idea to have a depency
in a Spring security API on SPECIFIC other security providing
frameworks such as EJB and Servlets - relying on the Principal
interface sort of introduces such a dependency, though.
=09
Please don't get me wrong: These are mainly my thoughts on how your
proposal would affect my current model... </quote> I totally get your
point. The way you're working is exactly the same as We do. We call
layers A & B (they don't differ much here) the module layer here, the
layer above is the component layer containing business logic... Modules
can't have security, can't have io, can't have networking etctera
(basically all EJB forbids)... The component layer contains
transactions/security, etctera.
=09
The thing is, that the security model J2EE provides does not meet our
demands when it comes to security for __parts of objects__. I'm trying
to figure out something to add this. This does not mean I'm intruding =
on
the module level (A+B). You can compare it a lot with the validation
framework. We're having the commons validator included as validator for
the Spring framework (just extend the validator interface and use the
commons validator there). Each data object in our system has a
validation.xml file (located right beside the class file, called
[class].validation.xml). This means I haven't intruded on the data
level, just added a descirptorfile, describing validation rules... No
extra interface (I hate that ;-). Same thing holds for the Hibernate
stuff... We're using a proprietary little farmework for integration of
Hibernate into Spring (would rather have used Spring here, but the
framework is already in place for a long time). The Hibernate files are
placed right besides the data files and are called [class].hbm.xml.
=09
Right now I want to add security. HOW the security is done, is actually
determine by the security-implementation (in this cause a
RoleObjectPermissionsWhatever, __located at the component level (Spring
+ C)__, however using the descriptor files from the module level
(A+B)... No extra interface or classes to extend, just an extra
description.
=09
What the criteria for the permissions would be, is totally up to the
implementation. In this case I need Role/Principal information, which
means I either need the SessionContext/EntityContext or a =
ServletRequest
(whatever, something using JAAS/javax.security). This means the
implementation can __never__ be located at the modulelayer (A+B). Other
implementations would provide time based permissions (between 2am-3am
not possible to edit backup schedule, because backup is actually done
then)...
=09
Anyway, I hope this clarifies things a little bit and I hope to get =
some
more feedback and stuff (people just shouting __arghh this is ugly__
would do as well!!!)...
=09
Thanx,
=09
Alef
=09
=09
=09
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
=
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01
/01
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
=09
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 18/07/2003
=09
=09
=09
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
=
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01
/01
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
=09
=09
=09
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
=
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/=
01
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
=09
NHzn=C8=B44i=11xjjz=0Ez=C9=AE\JNr =D3=BD Jjzqzm=D8=B6?X (=1E~zw X =
b=CB=9D? jg=EB=B0=A2=1Dz=ED=BD=96=ED=B2=97
|
|
From: Alef A. \(JTeam\) <al...@jt...> - 2003-08-20 10:27:33
|
I've been adding the TilesView and TilesConfigurer to the CVS just now... Using those you can use Tiles in combination with Spring. * In the docs/tiles directory a small (to be extended a bit more) document can be found describing how to use the Configurer. * In the lib/tiles directory the dependencies have been placed * In the springframework/web/servlet/view/tiles I've placed the sourcefiles * Test coverage isn't up to standards yet (33%). Do people have suggestions for testing rendering of views in general??? What do people think about the internationalization issue? Should we add SpringDefinitionsFactory (as suggested by Tarjei) as well as shall we just include this in an example or something. I kind of don't like the idea of adding extensions to Tiles classes to the Spring codebase... Any opinions? Alef P.s. any comments on code, tests or whatever are appreciated... |
|
From: <tri...@tr...> - 2003-08-20 09:45:55
|
Juergen, I had to merge my changes with yours in the JdbcTemplate. I added close() calls to the stmt, ps and rs objects when an exception was caught. I also removed the ReadOnlyResultSet that we talked about earlier. I also copied the new documentation to the website. Thomas > I've introduced timeout support for DataSourceTransactionManager and > HibernateTransactionManager last weekend. A transaction timeout can get > applied to Statement.setQueryTimeout, decreasing with every statement, for > JDBC drivers that actually interpret that. Same for Hibernate's > Query.setTimeout. Of course, the convenience classes apply this > automatically. Manual access code has to call > DataSourceUtils.applyTransactionTimeout(Statement) respectively > SessionFactoryUtils.applyTransactionTimeout(Query) to participate in > transaction timeouts. > > BTW, I've just added an Avalon section to our "lightweight containers" > article, on the occasion of the TSS discussion on PicoContainer. Thomas, > could you please put it on the website? > > Juergen > > > DI Jürgen Höller > Senior System Architect > ______________________________________ > > werk3ATS - division systementwicklung > part of werk3AT internetmedien oeg > > europaplatz 4 > A - 4020 linz > > t. +43 (0) 732 71 65 29 502 > f. +43 (0) 732 71 65 29 3 > mailto:jue...@we... > http://www.werk3at.com > ______________________________________ > werk3ATS - WIR ENTWICKELN ERFOLG > > > > ------------------------------------------------------- > This SF.net email is sponsored by Dice.com. > Did you know that Dice has over 25,000 tech jobs available today? From > careers in IT to Engineering to Tech Sales, Dice has tech jobs from the > best hiring companies. http://www.dice.com/index.epl?rel_code4 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Colin S. <col...@ex...> - 2003-08-20 04:59:54
|
Good stuff. I think this covers most use cases. The other option as you said would have been to have various jars which make up the functionality (split at the package or logical level), combined as needed, but I think then you get into a lot of management issues (ie it's a pain to have to combine 8 jars to get the full functionality). FWIW I think the layered jar approach is fine since most people using something in a higher layer will need most of the stuff in the lower layers. In any case, the subject of optimal packaging is probably worth revisiting every once in a while (e.g once or twice a year)... Regards, Colin jürgen höller [werk3AT] wrote: >Hi everybody, > >I've just revised our distribution jar files for 1.0 M1. There are now 6 of them: Each addresses a typical usage of the Spring Framework, specifying the respective contents and third-party dependencies. Libraries in brackets are optional, i.e. just necessary for certain functionality. > >Quoting from the new section in our readme.txt: > ><quote> > >* "spring-beans" (~90 KB) >- Target: basic bean container for wiring up within restricted environments like applets >- Contents: bean container, core utilities >- Dependencies: Commons Logging > >* "spring-aop" (~145 KB) >- Target: AOP-enabled bean container for wiring up and proxying any kind of components >- Contents: bean container, utilities, AOP framework >- Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB) > >* "spring-jdbc" (~230 KB) >- Target: JDBC access library, e.g. for use within EJBs or to enrich existing applications >- Contents: bean container, utilities, JDBC support, EJB support >- Dependencies: Commons Logging (Log4J, EJB 2.0) > >* "spring-orm" (~350 KB) >- Target: persistence and transaction library for JDBC/Hibernate/JDO, including AOP support >- Contents: bean container, utilities, AOP framework, transaction framework, JDBC support, O/R Mapping support, EJB access and support >- Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB; JTA, Hibernate, JDO, EJB 2.0) > >* "spring-context" (~430 KB) >- Target: application framework for use within or outside a J2EE container, e.g. for serving as middle tier application context within Struts or Tapestry web applications, or for standalone applications >- Contents: bean container, utilities, AOP framework, transaction framework, JDBC support, O/R Mapping support, EJB access and support, application context, web application context, validation framework >- Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB; JTA, Hibernate, JDO, EJB 2.0; Servlet 2.2) > >* "spring-full" (~550 KB) >- Target: web application framework for use within a J2EE container, including Spring's own web MVC and remoting support (and of course, suitable for any other usage where JAR size does not matter) >- Contents: bean container, utilities, AOP framework, transaction framework, JDBC support, O/R Mapping support, EJB access and support, application context, web application context, validation framework, web MVC framework, remoting support >- Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB; JTA, Hibernate, JDO, EJB 2.0; Servlet 2.3, JSP 1.2, JSTL, Velocity, iText, POI, Hessian, Burlap) > ></quote> > >I've hesitated a bit to introduce more jar files, but I guess such scenario-specific jars are easier to understand than fragmented package-level jars that need to be combined to make them work. Anyway, I'm open for feedback, of course: Does anyone miss a typical scenario, or consider one of the above unnecessary? > >Regards, >Juergen > > >DI Jürgen Höller >Senior System Architect >______________________________________ > >werk3ATS - division systementwicklung >part of werk3AT internetmedien oeg > >europaplatz 4 >A - 4020 linz > >t. +43 (0) 732 71 65 29 502 >f. +43 (0) 732 71 65 29 3 >mailto:jue...@we... >http://www.werk3at.com >______________________________________ >werk3ATS - WIR ENTWICKELN ERFOLG > > |
|
From: <jue...@we...> - 2003-08-19 23:05:55
|
I've introduced timeout support for DataSourceTransactionManager and = HibernateTransactionManager last weekend. A transaction timeout can get = applied to Statement.setQueryTimeout, decreasing with every statement, = for JDBC drivers that actually interpret that. Same for Hibernate's = Query.setTimeout. Of course, the convenience classes apply this = automatically. Manual access code has to call = DataSourceUtils.applyTransactionTimeout(Statement) respectively = SessionFactoryUtils.applyTransactionTimeout(Query) to participate in = transaction timeouts. BTW, I've just added an Avalon section to our "lightweight containers" = article, on the occasion of the TSS discussion on PicoContainer. Thomas, = could you please put it on the website? Juergen DI J=FCrgen H=F6ller Senior System Architect ______________________________________ werk3ATS - division systementwicklung part of werk3AT internetmedien oeg europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 502 f. +43 (0) 732 71 65 29 3 mailto:jue...@we... http://www.werk3at.com ______________________________________ werk3ATS - WIR ENTWICKELN ERFOLG |
|
From: <jue...@we...> - 2003-08-19 20:54:04
|
Hi everybody, I've just revised our distribution jar files for 1.0 M1. There are now 6 = of them: Each addresses a typical usage of the Spring Framework, = specifying the respective contents and third-party dependencies. = Libraries in brackets are optional, i.e. just necessary for certain = functionality. Quoting from the new section in our readme.txt: <quote> * "spring-beans" (~90 KB) - Target: basic bean container for wiring up within restricted = environments like applets - Contents: bean container, core utilities - Dependencies: Commons Logging * "spring-aop" (~145 KB) - Target: AOP-enabled bean container for wiring up and proxying any kind = of components - Contents: bean container, utilities, AOP framework - Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB) * "spring-jdbc" (~230 KB) - Target: JDBC access library, e.g. for use within EJBs or to enrich = existing applications - Contents: bean container, utilities, JDBC support, EJB support - Dependencies: Commons Logging (Log4J, EJB 2.0) * "spring-orm" (~350 KB) - Target: persistence and transaction library for JDBC/Hibernate/JDO, = including AOP support - Contents: bean container, utilities, AOP framework, transaction = framework, JDBC support, O/R Mapping support, EJB access and support - Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB; JTA, = Hibernate, JDO, EJB 2.0) * "spring-context" (~430 KB) - Target: application framework for use within or outside a J2EE = container, e.g. for serving as middle tier application context within = Struts or Tapestry web applications, or for standalone applications - Contents: bean container, utilities, AOP framework, transaction = framework, JDBC support, O/R Mapping support, EJB access and support, = application context, web application context, validation framework - Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB; JTA, = Hibernate, JDO, EJB 2.0; Servlet 2.2) * "spring-full" (~550 KB) - Target: web application framework for use within a J2EE container, = including Spring's own web MVC and remoting support (and of course, = suitable for any other usage where JAR size does not matter) - Contents: bean container, utilities, AOP framework, transaction = framework, JDBC support, O/R Mapping support, EJB access and support, = application context, web application context, validation framework, web = MVC framework, remoting support - Dependencies: Commons Logging, AOP Alliance (Log4J, CGLIB; JTA, = Hibernate, JDO, EJB 2.0; Servlet 2.3, JSP 1.2, JSTL, Velocity, iText, = POI, Hessian, Burlap) </quote> I've hesitated a bit to introduce more jar files, but I guess such = scenario-specific jars are easier to understand than fragmented = package-level jars that need to be combined to make them work. Anyway, = I'm open for feedback, of course: Does anyone miss a typical scenario, = or consider one of the above unnecessary? Regards, Juergen DI J=FCrgen H=F6ller Senior System Architect ______________________________________ werk3ATS - division systementwicklung part of werk3AT internetmedien oeg europaplatz 4 A - 4020 linz t. +43 (0) 732 71 65 29 502 f. +43 (0) 732 71 65 29 3 mailto:jue...@we... http://www.werk3at.com ______________________________________ werk3ATS - WIR ENTWICKELN ERFOLG |
|
From: <jue...@we...> - 2003-08-19 10:59:17
|
Lars,
Sorry for your frustration - please don't give up :-)
I agree that we should come up with a sample application that uses =
Spring and Hibernate. At this point, I can only say it's in the works, =
as the sample app will also serve for some other purposes. It won't get =
ready before my trip to Australia (the whole of September) though, so we =
will have to wait for October.
Anyway, let's dig into the webapp-hibernate skeleton. Please don't be =
confused by all the options with container resources vs local resources, =
I know that's a rather complex domain (there's even a whole article on =
that in the documentation section the Spring website).
How to set up a Spring/Hibernate application?
1. Define a *JDBC DataSource*. You can take a JNDI one or a local one =
like a Jakarta Commons BasicDataSource. You have chosen a JNDI one =
managed by WebLogic - that's fine.
2. Define a *Hibernate SessionFactory*. Again, you can take a JNDI one =
(only advisable with the Hibernate JCA adapter) or a local one via =
LocalSessionFactoryBean. The latter can get a reference to the =
DataSource from step 1, so that Hibernate accesses that database =
underneath. In your case, choose LocalSessionFactoryBean, as illustrated =
by the webapp-hibernate skeleton. Don't worry about the JNDI option or =
JCA for that matter.
3. Define a *transaction manager*. HibernateTransactionManager or =
JtaTransactionManager are appropriate here. The former needs a reference =
to the Hibernate SessionFactory, as illustrated by the webapp-hibernate =
skeleton. The latter requires the DataSource from step 1 to be a =
transactional container DataSource.
4. Feel free to use any of the above resources in your application =
beans, passed to them via bean references. Internally, your application =
beans can of course use convenience classes like HibernateTemplate and =
TransactionTemplate for resource access.
That's all you need to set up a working Spring/Hibernate application.
You seem to have gotten confused by the option to use a JNDI =
SessionFactory vs a JNDI DataSource. These are two entirely different =
things. As outlined above, you have to choose a respective strategy for =
*either* resource, the JDBC DataSource and the Hivernate SessionFactory.
The comment above the LocalSessionFactoryBean definition in the =
webapp-hibernate skeleton illustrates an alternative for *SessionFactory =
setup*. This has nothing to do with *DataSource setup*, thus it does not =
pose a conflict. I hope I've been able to make that clear.
Finally, thanks for your feedback - there's always room for =
improvement...
Juergen
-----Original Message-----
From: Lars Fischer [mailto:lar...@gm...]
Sent: Tuesday, August 19, 2003 11:52 AM
To: spr...@li...
Subject: [Springframework-developer] Too many options
Hi all,
I'm a little bit frustrated getting started with Spring and Hibernate.
Hibernate works fine now in a non J2EE environment.=20
But I still don't know what to define with Hibernate and Spring (ends=20
up in deployment-descriptor hell).
Has anyone an example with all options (that make sense) when developing
an application with Spring, Hibernate and BEA WebLogic 8.1 ?
The "applicationContext.xml" from the Hibernate skeleton doesn't make
it clear which of the options I should use.
I've defined a connection pool and a data source in WLS and can access =
it
with=20
<bean id=3D"exampleDataSource"
class=3D"com.interface21.jndi.JndiObjectFactoryBean">
<property name=3D"jndiName">
<value>refHibernate</value>
</property>
</bean>
The next option in "applicationContext.xml" is=20
<bean id=3D"exampleSessionFactory"
class=3D"com.interface21.orm.hibernate.LocalSessionFactoryBean">
<property name=3D"mappingResources">
...
There is a comment above stating
" - This definition can be replaced by a JndiObjectFactoryBean =
definition
for fetching
- a JNDI-bound SessionFactory, but this only makes sense when using
Hibernate's
- JCA Connector (not recommended for most types of applications)."
Does this mean that I should only use one of these options ?
These things are all explained in 'high level' documents one can =
understand
if
reading them carefully. But I just want to get started immediately and =
not
spending
hours of reading this kind of abstract stuff.
IMO it's best to stop the Hibernate/Spring testing and use JDBC (where
examples
are provided) until someone provides a real world example with Hibernate
though I think it's like going back=20
a few years when programming with Delphi.
Sometimes it's bad to have too many options. Think of a store where you =
can
buy hundreds
of different products of the same kind. It will take you forever to come =
to
a decision.
Trying with JDBC now ...
Regards
Lars
|
|
From: Lars F. <lar...@gm...> - 2003-08-19 09:51:43
|
Hi all,
I'm a little bit frustrated getting started with Spring and Hibernate.
Hibernate works fine now in a non J2EE environment.
But I still don't know what to define with Hibernate and Spring (ends
up in deployment-descriptor hell).
Has anyone an example with all options (that make sense) when developing
an application with Spring, Hibernate and BEA WebLogic 8.1 ?
The "applicationContext.xml" from the Hibernate skeleton doesn't make
it clear which of the options I should use.
I've defined a connection pool and a data source in WLS and can access it
with
<bean id="exampleDataSource"
class="com.interface21.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>refHibernate</value>
</property>
</bean>
The next option in "applicationContext.xml" is
<bean id="exampleSessionFactory"
class="com.interface21.orm.hibernate.LocalSessionFactoryBean">
<property name="mappingResources">
...
There is a comment above stating
" - This definition can be replaced by a JndiObjectFactoryBean definition
for fetching
- a JNDI-bound SessionFactory, but this only makes sense when using
Hibernate's
- JCA Connector (not recommended for most types of applications)."
Does this mean that I should only use one of these options ?
These things are all explained in 'high level' documents one can understand
if
reading them carefully. But I just want to get started immediately and not
spending
hours of reading this kind of abstract stuff.
IMO it's best to stop the Hibernate/Spring testing and use JDBC (where
examples
are provided) until someone provides a real world example with Hibernate
though I think it's like going back
a few years when programming with Delphi.
Sometimes it's bad to have too many options. Think of a store where you can
buy hundreds
of different products of the same kind. It will take you forever to come to
a decision.
Trying with JDBC now ...
Regards
Lars
|
|
From: Lars F. <lar...@gm...> - 2003-08-19 08:40:13
|
Rod, thanks for the response ! I'm glad that many Spring developers use WLS. One of the main problems when using WebWork is lacking support for WLS. I was almost sure it was my problem with the app server configuration because I know that you're an experienced WLS developer. It's likely that I'll ask more dumb questions but at the moment I just want to get started as fast as possible with Spring so I can migrate existing applications for future releases. Maybe with the good community support I can provide a sample application one day. Thanks a lot Lars > Lars, > > I'm at an internet cafe in the Rockies, so I can't examine > your specific problem, but I've used Spring extensively with > WLS 8.1 and a little with WLS 7.0 and the JNDI lookup (and > everything else) works just fine for me. (I've used just > about every part of Spring under WLS both inside and outside > the EJB container, including AOP.) > > Regards, > Rod > |
|
From: Lars F. <lar...@gm...> - 2003-08-19 08:32:03
|
Thomas, thanks a lot, this solved my problem ! I forgot to define the weblogic.xml stuff. Checked the docs yesterday but BEA always speaks of EJBs (and I don't use them now). This could be a topic for the WIKI and may help future Spring users (using WLS with EJBs before) to get started. Thanks again Lars > Lars, > > Try this: > > I'm assuming that you have a datasource set up in WebLogic and that it's > JNDI > name is cxwHibernate. You should check this name by viewing the JNDI tree > from > WebLogic console. > > Make sure that you have a <resource-ref> set up in web.xml that you > reference in > the applicationContext.xml (I'll use the name refHibernate). In > weblogic.xml > you link this resource-ref to the actual JNDI name specified in WLS > configuration (I'll use the name cxwHibernate). > > In application.xml use the following: > > <beans> > > <bean id="dataSource" > class="com.interface21.jndi.JndiObjectFactoryBean"> > <property name="jndiName"><value>refHibernate</value></property> > </bean> > > <!-- more bean definitions --> > > <beans> > > > In web.xml use: > > <resource-ref> > <description>The data source ref name</description> > <res-ref-name>refHibernate</res-ref-name> > <res-type>javax.sql.DataSource</res-type> > <res-auth>Container</res-auth> > </resource-ref> > > > In weblogic.xml use: > > <weblogic-web-app> > <description>WebLogic data source JNDI name</description> > <reference-descriptor> > <resource-description> > <res-ref-name>refHibernate</res-ref-name> > <jndi-name>cxwHibernate</jndi-name> > </resource-description> > </reference-descriptor> > </weblogic-web-app> > > If this does not work, could you post the web.xml and weblogic.xml that > you are > using. > > Thomas > > > Hi all, > > > > I have a problem with a DataSource definition in applicationContext.xml. > > > > I've defined a connection pool and a data source with WebLogic 8.1 but > > at deployment time Spring says: > > > > 18.08.2003 17.42 Uhr CEST> <Warning> <HTTP> <BEA-101162> <User defined > > listener com.interface21.web.context.ContextLoaderListener failed: > > com.interface21.context.ApplicationContextException: Cannot load > > configuration: problem > > instantiating or initializing beans; nested exception is: > > com.interface21.beans.FatalBeanException: afterPropertiesSet on > with > > name 'cwxDataSource' threw an exception; nested exception is: > > javax.naming.NameNotFoundException: While trying to look up > > comp/env/cxwHibernate in /app/webapp/springapp/22589165.; remaining name > > 'comp/env/cxwHibernate'.> > > > > This may be a WebLogic issue but I can't find any good BEA documentation > for > > this issue. > > > > Does anyone have experience configuring WebLogic JNDI with Spring ? > > > > Thanks > > Lars > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > > Data Reports, E-commerce, Portals, and Forums are available now. > > Download today and enter to win an XBOX or Visual Studio .NET. > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > |
|
From: Tarjei S. <lo...@on...> - 2003-08-19 04:00:24
|
On Mon, Aug 18, 2003 at 11:36:39PM +0200, Alef Arendsen (JTeam) wrote: > I've taken the Configurer approach, but might want to add the Resolver later on... > > Why? > > Tiles includes a Locale specific DefinitionsFactory (I18FactorySet) that loads definition files for different locales just as the ResourceBundleViewResolver does. However, creating both properties-files for the ResourceBundleViewResolver and definition files for the Tiles definitions (one for each language) seems silly... When using the InternalResourceViewResolver localization isn't (as the documentation also says) possible... It would be possible to use InternalResourceViewResolver in this scenario if we let Tiles do all the locale specific definition resolution. If InternalResourceViewResolver is configured to use TilesView as the viewclass then the localization can be delegates to Tiles itself since it provides that possibility through the I18nFactorySet class. One problem with I18FactorySet is that it is hardcoded to get the Locale for the request from the users session. It has nowhere near the kind of flexibility that Spring provides when it comes to this. Therefore it might be necessary to subclass I18nFactorySet and override the getDefinitionsFactoryKey method to use RequestContextUtils to get the locale instead. With this simple touch Tiles can make use of the advanced locale resolution strategies that spring provides. > I didn't run into an app needing different definitions per language, but this might be necessary for some people. Fro now the Configurer will do!! I'm using Tiles to do just this at the moment and I find it highly useful for pages that contains a lot of content that needs to be localized but where it isn't reasonable to put all the content in a ResouceBundle. By simply extending I18nFactorySet and using RequestContextUtils I'm able to make full use of Tiles I18N capabilities. I've attached SpringDefinitionsFactory as an example of how this may be done. -- Tarjei Skorgenes lo...@on... |
|
From: Colin S. <col...@ex...> - 2003-08-19 01:11:03
|
I was just suggesting another build option since there were already a few other variants with less layers. I agree that at this point it's probably not worth it. Maybe if it starts adding up to more (i.e. I don't like carrying around 600k of baggage when 350k would do, etc., although Spring is by no means the worst culprit in this). As for the Tapestry stuff, I'm still figuring out some best practices, but perhaps in a week or so I'll do a little writup and a small sample. jürgen höller [werk3AT] wrote: >Hi Colin, > >I'm delighted to hear that someone is using a Spring/Tapestry combo! If you are willing to document the setup for using Tapestry as web framework with Spring, please do so! > >We could also add respective notes for Struts, as it is particularly easy to combine that with Spring: Simply get a reference to the servlet context via getServlet().getServletContext() from within a Struts action, and fetch the root web application context via WebApplicationContextUtils. We could even offer a simple Action base class for that, especially now that we will have a struts.jar in the lib directory anyway. > >Regarding a build with everything but the web MVC framework: Are you concerned regarding the size of the jar? spring-full is currently just ~550 KB, and Tiles will only make it grow a few KB just like Velocity, as most of the stuff is in third-party libraries that aren't included anyway. I don't see any drawback if you still use the spring-full jar but just include the third-party libraries that you're actually using. The additional classes in spring-full don't hurt besides the size. Or do I miss something here? > >Juergen > > > > -----Ursprüngliche Nachricht----- > Von: Colin Sampaleanu [mailto:col...@ex...] > Gesendet: Mo 18.08.2003 23:54 > An: jürgen höller [werk3AT] > Cc: al...@jt...; spr...@li... > Betreff: Re: [Springframework-developer] Adding Tiles to CVS... > > > > Can I suggest that the build produce another variant of Spring which > doesn't include the Spring mvc stuff or code like this Tiles support, > but does includethe non web-framework specific but web related classes? > I am talking about things like WebApplicationContextUtils. I am > (happily) using Spring with the Apache Tapestry framework. > WebApplicationContext, WebApplicationContextUtils, and other generic > classes which make the spring container more usable in a servlet > environment are useful to me, but I don't want to bring in other baggage > like the Spring web MVC stuff, or now the Tiles support. > > Also, I find Tapestry to be a very good web framework, which works at a > much higher level (component-based) than most web ui frameworks. Is > there interest in adding a document into Spring describing how to best > use Spring with Tapestry? The cleanest mechnism (allowing you to access > Spring context properties declaratively from Tapestry pages) is not > necessarilly that intuitive to figure out, so I think my > experimentation/work would be useful to other people. > > Regards, > Colin > > > jürgen höller [werk3AT] wrote: > > >Hi Aref, > > > >Then please go ahead! :-) > > > >There's just one issue that I'd like to resolve: How do you set up Tiles on startup? You've used a TilesViewResolver before which should not be necessary. We've discussed a TilesConfigurer, analogous to the existing VelocityConfigurer. What strategy did you choose in the end? > > > >Regarding the libraries: Please only include the compile-time dependencies, respectively the ones needed for executing the test suite. We did the same for Hibernate to avoid too much bloat. All of the libraries should go in lib/tiles, analogous to the existing lib/hibernate. > > > >Don't forget to use the new "spring" module with the org.springframework packages... ;-) > > > >Juergen > > > > > > > > -----Ursprüngliche Nachricht----- > > Von: Alef Arendsen (JTeam) [mailto:al...@jt...] > > Gesendet: Mo 18.08.2003 22:13 > > An: spr...@li... > > Cc: > > Betreff: [Springframework-developer] Adding Tiles to CVS... > > > > > > > > Hi all, > > > > I'm basically ready to add the Tiles functionality to the CVS. It's tested and works fine. > > > > We need to decide now which dependencies to include. Struts is dependant on the following libraries. The ones that have an * with them are the ones that are both compile-time and runtime, libraries without * are only runtime dependencies: > > > > *commons-beanutils > > *commons-digester > > *commons-logging (we already have that one) > > *struts (of course) > > commons-collections > > commons-lang > > commons-validator > > commons-fileupload > > jakarta-oro > > > > It's quite a list, but from the previous mails I saw nobody really objected to including them. So just add them??? > > > > Regards, > > > > Alef > > > > == > > JTeam B.V. > > Donker Curtiusstraat 7-412 > > 1051 JL Amsterdam > > T: +31 20 486 20 36 > > M: +31 6 24 11 1996 > > F: +31 84 837 00 00 > > E: al...@jt... > > W: www.jteam.nl <file://www.jteam.nl> > > > |