Oh, one more thing, EL only needs the getters.  So worse case you can simply
lose the setters.

Gregg

On Wed, Feb 4, 2009 at 5:26 PM, Gregg Bolinger
<[email protected]>wrote:

> As far as the readability issue I tend to keep all my simple
> getters/setters at the bottom of the class.  Event methods towards the top.
> If you don't scroll passed event methods, you never see them. :)
>
> You can also use Groovy for your action beans if you live on the cutting
> edge a bit. That can shorten your code a bit.  See Freddy's post here:
>
>
> http://www.stripesbook.org/blog/index.php?/archives/23-Stripes-and-Groovy.html
>
> Gregg
>
>
> On Wed, Feb 4, 2009 at 5:21 PM, Ross Sargant <[email protected]> wrote:
>
>> Freddy,
>>    Thanks very much. I didn't realize that public fields won't work with
>> JSP EL.
>> That is indeed a snag in the plan.  I'd hoped I could do everything the
>> same way.
>>
>> I will just leave everything as it is. We're using stripes to develop the
>> configuration gui(s) across many independent modules of our system so we
>> have a lot of action beans. This change would have dropped our LOC and made
>> our code more readable (in my opinion anyway), but I guess it wasn't meant
>> to be. Bummer..
>>
>> Thanks again though.
>>
>>
>>
>> On Wed, Feb 4, 2009 at 5:03 PM, Freddy Daoud <[email protected]> wrote:
>>
>>> Hi Ross,
>>>
>>> Just to add that besides the validation bug that is now fixed in
>>> SVN, you'll also have to consider that public fields work well
>>> with Stripes, but not JSP EL. That's fine if your fields are only
>>> used with the Stripes tag library (e.g. in a form), but trying to
>>> display the value with ${actionBean.bar} won't work. It can work
>>> with FreeMarker, but I won't bother you with the details of that
>>> unless you (or someone else) asks.
>>>
>>> Cheers,
>>> Freddy
>>> http://www.stripesbook.com
>>>
>>> On Wed, 4 Feb 2009 21:43:50 +0100, "Marijan Mili&#269;evi&#263;"
>>> <[email protected]> said:
>>> > here is jira issue:
>>> > http://www.stripesframework.org/jira/browse/STS-604
>>> >
>>> > ________________________________________
>>> > From: Marijan Mili&#269;evi&#263; [[email protected]]
>>> > Sent: Wednesday, February 04, 2009 9:41 PM
>>> > To: Stripes Users List
>>> > Subject: Re: [Stripes-users] Is it possible to avoid writing
>>> > getters&setters for        action bean request parameters?
>>> >
>>> > Hi Ross,
>>> >
>>> > I believe this is an already fixed bug, you'll need to build stripes
>>> > yourself from the trunk though, as 1.5.1 is not released yet...
>>> >
>>> > -m
>>> > ________________________________________
>>> > From: Ross Sargant [[email protected]]
>>> > Sent: Wednesday, February 04, 2009 9:37 PM
>>> > To: Stripes Users List
>>> > Subject: [Stripes-users] Is it possible to avoid writing
>>> getters&setters
>>> > for    action bean request parameters?
>>> >
>>> > Hi,
>>> >    I seem to hardly ever have any real logic in my action bean
>>> >    getter/setter methods and feel they add unnecessary clutter to the
>>> >    code. I was interested in refactoring the following:
>>> >
>>> > class Foo extends MyBaseActionBean{
>>> >
>>> >  @Validate(required=true,minvalue=5,maxvalue=10)
>>> >   private Integer bar;
>>> >
>>> >   public Integer getBar(){
>>> >       return bar;
>>> >   }
>>> >
>>> >   public void setBar(Integer value){
>>> >       this.bar=value;
>>> >   }
>>> >
>>> > }
>>> >
>>> > to
>>> >
>>> > class Foo extends MyBaseActionBean{
>>> >
>>> >      @Validate(required=true,minvalue=5,maxvalue=10)
>>> >     public Integer bar;
>>> >
>>> > }
>>> >
>>> > However, it seems like validation does not work correctly when I do
>>> this.
>>> >   I do get type conversion failures and binding seems to work but other
>>> > validations (like a range check) are not applied and my event handler
>>> > runs with invalid data.
>>> >
>>> > Am I missing something here? Is there some reason this can't work?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Ross Sargant
>>> >
>>> > TVR Communications LLC
>>> > Software Engineer
>>> > 3275 W Hillsboro Blvd,Suite 300,Deerfield Beach, Florida,33442
>>> >
>>> > http://www.tvrc.com
>>> >
>>> > p: 954-571-2017 x2108
>>> >
>>> > email: [email protected]<mailto:[email protected]>
>>> >
>>> >
>>> ------------------------------------------------------------------------------
>>> > Create and Deploy Rich Internet Apps outside the browser with
>>> > Adobe(R)AIR(TM)
>>> > software. With Adobe AIR, Ajax developers can use existing skills and
>>> > code to
>>> > build responsive, highly engaging applications that combine the power
>>> of
>>> > local
>>> > resources and data with the reach of the web. Download the Adobe AIR
>>> SDK
>>> > and
>>> > Ajax docs to start building applications
>>> > today-http://p.sf.net/sfu/adobe-com
>>> > _______________________________________________
>>> > Stripes-users mailing list
>>> > [email protected]
>>> > https://lists.sourceforge.net/lists/listinfo/stripes-users
>>> >
>>> >
>>> ------------------------------------------------------------------------------
>>> > Create and Deploy Rich Internet Apps outside the browser with
>>> > Adobe(R)AIR(TM)
>>> > software. With Adobe AIR, Ajax developers can use existing skills and
>>> > code to
>>> > build responsive, highly engaging applications that combine the power
>>> of
>>> > local
>>> > resources and data with the reach of the web. Download the Adobe AIR
>>> SDK
>>> > and
>>> > Ajax docs to start building applications
>>> > today-http://p.sf.net/sfu/adobe-com
>>> > _______________________________________________
>>> > Stripes-users mailing list
>>> > [email protected]
>>> > https://lists.sourceforge.net/lists/listinfo/stripes-users
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Create and Deploy Rich Internet Apps outside the browser with
>>> Adobe(R)AIR(TM)
>>> software. With Adobe AIR, Ajax developers can use existing skills and
>>> code to
>>> build responsive, highly engaging applications that combine the power of
>>> local
>>> resources and data with the reach of the web. Download the Adobe AIR SDK
>>> and
>>> Ajax docs to start building applications today-
>>> http://p.sf.net/sfu/adobe-com
>>> _______________________________________________
>>> Stripes-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>>
>>
>>
>>
>> --
>> Ross Sargant
>>
>> TVR Communications LLC
>> Software Engineer
>> 3275 W Hillsboro Blvd,Suite 300,Deerfield Beach, Florida,33442
>>
>> http://www.tvrc.com
>>
>> p: 954-571-2017 x2108
>>
>> email: [email protected]
>>
>>
>> ------------------------------------------------------------------------------
>> Create and Deploy Rich Internet Apps outside the browser with
>> Adobe(R)AIR(TM)
>> software. With Adobe AIR, Ajax developers can use existing skills and code
>> to
>> build responsive, highly engaging applications that combine the power of
>> local
>> resources and data with the reach of the web. Download the Adobe AIR SDK
>> and
>> Ajax docs to start building applications today-
>> http://p.sf.net/sfu/adobe-com
>> _______________________________________________
>> Stripes-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>>
>
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to