Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Design struts 2

 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! In my webapplication a user can list items in a db. The Items can be fetched in many numerous ways. By brand, by category, subcategory, department etc. The view looks exactly the same but the top is slightly different.

When the items is viewed a user can filter the items to be more specific. The problem is I don't know exactly on how to design the Action class. Should I use one action class that has get,set for brand, department etc and check if the parameter is empty or what is the normal approach?

Sould I have a diffrent Action class when Brand, Department, Subcategory ( in a droplist in the view ).

Any suggestions
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like all the business logic can be in your pojo class/es, and there can be only 1 action class.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I constructs this action class? A lot of sets and gets? But I need to do all the quering from the action class



Is this correct?
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not completely sure it would help you, but have you looked at the Displaytag library? displaytag.sourceforge.net/11/

A flexible action that can sort and filter as loosely as you describe would be pretty difficult to maintain. I would look to see if you could retrofit your problem into using displaytag and you'll be happy you did.

-Wes
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic