Hi, Michael
You could use a "searchCriteria" approach that I use. I use it with
spring/hibernate, but it could be used with any bussiness layer. Ok I'll try
to explain in general:
Suppose we have a PeopleCriteria class
****
class PeopleCriteria {
    String name;
    String surname;
    Boolean sortByName;
    Boolean sortBySurname;
    Boolean asc;
//Getters and Setters
}
****
we store object of this criteria in session, so the ActionBean could look
like that:
***
public class PeopleActionBean extends BaseActionBean {

    PeopleCriteria criteria;
    public PeopleCriteria getCriteria() {
        if (criteria == null) {
            criteria =
(PeopleCriteria)session.getAttribute("peopleSearchCriteria");
        }
        return criteria;
    }

    List<Person> people;
    public List<Person> getPeople() {
        if (people == null) {
            people =
services.getPeopleService().getPeopleByCriteria(getCriteria());
        }
        return people;
    }
}
***
You could also have a form with search parameters, it is flexible approach,
for example you could have parameter like "?criteria.name=Alex" and it will
be binded to search criteria object.
You just have to code the logic of method  List<Person>
getPeopleByCriteria(PeopleCriteria criteria);

May be this approach isn't so good, I'd like to see other ways if someone
would like to show.
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to