Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 Design Question - Solid Opinions Needed...

 
JJ Jones
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All-

My environment: Struts2, Spring, Annotated Hibernate, Sitemesh

I have a subclass hierarchy in my Hibernate "model"....

Product
+SomeCustomProduct (extends Product)
+AnotherCustomProduct (extends Product)

I want to create an "extendable" user interface/action design that can quickly allow me to create new views for addtional custom products. These custom products need to have validation on certain fields etc.

Here is what I was thinking...

- Create an abstract "ProductAction" that handles the simple stuff
- Create a concrete "SomeCustomProductAction", that handles the saving etc.

The issue is that I need to have a new set of views for the "CustomProduct" so I can capture that information, however, I am finding that when I go down this road, my struts.xml is getting quite complex.

Is there a way in Struts "out of the box" to handle this? Are there any approaches anyone can propose to make extending "actions/views" easier?

Thanks in advance!





 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without knowing more I'd point you first at wildcards in results, and dynamic result parameters, which can be used to pass action properties to result configuration.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic