If you use setCommandName("phoneNumber") in the controller, what links that particular name to a particular class? Is it the bean name in the bean xml file? If I use the command as the path in the bind tag, and that command was set as my phone number class, then I can reference attributes of it just like ${command.areaCode} and ${command.number}?
You will still want to call setCommandClass to make the association. The call to setCommandName just changes the binding name. So if you don't set the comand name, you use ${command.areaCode} and ${command.number}. If you set it to "phoneNumber", you use ${phoneNumber.areaCode} and ${phoneNumber.number}.
There are 2 ways to associate your controller with the class you are working with.
1. Use setCommandClass() in the constructor. This is more useful if you are not editing an exisiting item.
2. Override formBackingObject(). This allows you to do a more complex initialization, such as pulling in an exisiting item from the db.
Take a look at the Petclinic sample app and observe the differences between an "edit" vs. an "add" form controller.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg