temp temp wrote:
I am implementing pagination for most of my jsp's so I
created a pagination bean with properties corresponding to pagination and this
bean extends to ActionForm .
All my formbeans extend to the pagination bean class.
In all my action classes I am repeating code to set
values corresponding to pagination and the rest is
setting properties specific to formbeans . I want to
avoid the repetation of code for setting pagination
values in my action classes . Is there way to avoid
this.
Sure.
Refactor the code out into an Action base class.
Or create an interface and implementations that each action can instantiate that do the right thing for that particular bean and/or Action.
Or put the code in the formbean (which doesn't seem like a good idea).
Or move the pagination code out of the form bean (where it probably doesn't belong) and put it in a class that knows about collections and can paginate them.
Or put the pagination into a presentation-layer tool like a tag class that does all the work for you (or use one of several existing solutions).
Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]