Re: Draft docs, Debugging Struts some Screen shot are missing
It's ok now, but it will be updated with next release - soon 2013/9/10 Lukasz Lenart : > 2013/9/7 Chris : >> Thank you. >> I'm affraid the first one is still missing , after this phrase : >> Clicking on the link for the configuration browser will cause the Struts 2 >> framework to return this page to your browser. >> Screen shot "Actions in namespace" > > Yes, I know - trying to solve the problem globally with SiteExporter > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Draft docs, Debugging Struts some Screen shot are missing
Thanks for the information De : Lukasz Lenart À : Struts Users Mailing List Envoyé le : Mardi 17 septembre 2013 9h31 Objet : Re: Draft docs, Debugging Struts some Screen shot are missing It's ok now, but it will be updated with next release - soon 2013/9/10 Lukasz Lenart : > 2013/9/7 Chris : >> Thank you. >> I'm affraid the first one is still missing , after this phrase : >> Clicking on the link for the configuration browser will cause the Struts 2 >> framework to return this page to your browser. >> Screen shot "Actions in namespace" > > Yes, I know - trying to solve the problem globally with SiteExporter > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How configure struts2 to get validation rules from Spring via @value
We are using spring 3 and struts 2. We use spring @value annotation to get values from property files. We want to get validation rules from property files instead of hard-coding them in action. Here is sample property system.properties transfer.account.min.amount=10 Here is the action: publicclassTransferToAccountimplementsPreparable{@Value("${transfer.account.min.amount}")publicStringminAmount;//...execute and other methods omitted@IntRangeFieldValidator(type =ValidatorType.FIELD,min ="${minAmount}",key ="validate.int.min")publicvoidsetAmount(Integeramount){this.amount =amount;} The minAmount is populated correctly by value 10, but the validation is not working. To see if parameters are passed correctly, I make a test as below. Assume we want to get a key from spring managed property file ( This is just a test ;) ) system.properties transfer.account.min.amount.key=validate.int.min The resource bundel is: validate.int.min = This field must be more than ${min} ...and make this change @IntRangeFieldValidator(type =ValidatorType.FIELD,min ="${minAmount}",key ="${transfer.account.min.amount.key}") Now when an error happens the validation message shows validate.int.min, instead of fetching this value from resource bundle! Of course, when you run below code: @IntRangeFieldValidator(type =ValidatorType.FIELD,min ="${minAmount}",key ="validate.int.min") The error message is fetched resource bundle correctly! If I can use annotation in this way, please let me know what is my mistake! If I can not use annotations like this, please let me know what is the best way to avoid hard coding the validaiton rolls in actions. ~Regards, ~~Alireza Fattahi
Re: How configure struts2 to get validation rules from Spring via @value
Code formatting? Maybe use some web service to present your code. Does system.properties is defined as a Struts 2 properties file? 2013/9/17 Alireza Fattahi : > We are using spring 3 and struts 2. We use spring @value annotation to get > values from property files. > We want to get validation rules from property files instead of hard-coding > them in action. > Here is sample property system.properties transfer.account.min.amount=10 > Here is the action: > publicclassTransferToAccountimplementsPreparable{@Value("${transfer.account.min.amount}")publicStringminAmount;//...execute > and other methods omitted@IntRangeFieldValidator(type > =ValidatorType.FIELD,min ="${minAmount}",key > ="validate.int.min")publicvoidsetAmount(Integeramount){this.amount =amount;} > The minAmount is populated correctly by value 10, but the validation is not > working. > > > To see if parameters are passed correctly, I make a test as below. > Assume we want to get a key from spring managed property file ( This is just > a test ;) ) > system.properties > transfer.account.min.amount.key=validate.int.min > The resource bundel is: validate.int.min = This field must be more than ${min} > ...and make this change > @IntRangeFieldValidator(type =ValidatorType.FIELD,min ="${minAmount}",key > ="${transfer.account.min.amount.key}") > Now when an error happens the validation message shows validate.int.min, > instead of fetching this value from resource bundle! > Of course, when you run below code: > @IntRangeFieldValidator(type =ValidatorType.FIELD,min ="${minAmount}",key > ="validate.int.min") > The error message is fetched resource bundle correctly! > > > If I can use annotation in this way, please let me know what is my mistake! > If I can not use annotations like this, please let me know what is > the best way to avoid hard coding the validaiton rolls in actions. > > > ~Regards, > ~~Alireza Fattahi - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org