Announcement Announcement Module
Collapse
No announcement yet.
commandClass and innner classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • commandClass and innner classes

    Hello

    Would it make sense to write a commandClass as an inner class of a class that extends SimpleFormController?

    How would I go about configuring the XML around it?

    Basically, I'd like to avoid cluttering my domain model with commandClasses that are little more than objects for capturing form data.

    Thanks

    Mark

  • #2
    Hello mark*,
    You certainly can use an innerclass, or any publically accessible class that you can instanciate object with. If you do, in your xml, you would specify the command class with your inner class full name, like "mypackage.MySimpleFormController$MyCommand.class" .

    If your domain class already have all the fields matching to the form data for capturing, then why not just use the domain class as CommandObject? If you need additional field, you can always extends it, and place that class under same package as controller. Use package to organize your code.

    -Z

    Comment

    Working...
    X