wood burning stoves 2.0*
The moose likes Struts and the fly likes Design Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Design Question" Watch "Design Question" New topic
Author

Design Question

bill mcclure
Greenhorn

Joined: Sep 13, 2005
Posts: 2
I have an application with the following page flow:
choose Product Type --> choose Product Model --> create/edit chosen model

Currently we only have one form for all the product types. We now want to expand this to have a different edit form per Product Type.

Should we have a forward for each of the various product type editors? Something like this logic in the Action (after choose Model):
if (isProduct1) {
mapping.findForward("product1");
} else if (isProduct2) {
mapping.findForward("product2");
}...

Seems like there should be a better way. Any ideas?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Howdy Bill!

Have you ever messed around with map backed forms? Using a map backed form might be just what you need to make your ActionForm generic enough to hold any of the different Product Types.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design Question