Results 1 to 3 of 3

Thread: CommandClass on Spring MVC

  1. #1
    Join Date
    Nov 2004
    Posts
    13

    Default CommandClass on Spring MVC

    Hello,
    I'm quite new in Spring, but have a question on commandClass.

    In a typical web app, we build value beans for business logic to use. And we use those model beans in struts as form beans. Of course, some web form page requires multiple domains to be combined, so following config are coded in Struts.

    <form-bean name="formA" type="DynaActionForm">
    <form-property name="domainA" type="com.dom.D1" />
    <form-property name="domainB" type="com.dom.E1" />
    </form-bean>

    This works fine and if another one is needed, we just add another domain.

    Now, in Spring, we define commandClass that tied to only single class type and there is no where to specify more commandClasses to be added to.


    1. Is there similar functionality in Spring that just does the above?

    2. Do I have to create a new set of form beans that only used for web layer, then move each properties to domain beans?

    Thanks in advance!!!

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    2. Do I have to create a new set of form beans that only used for web layer, then move each properties to domain beans?
    In Spring you don't need form beans at all. Bind directly to your domain beans. Thats just one of the major advantages of Spring MVC over Struts.

  3. #3
    Join Date
    Aug 2004
    Posts
    109

    Default Re: CommandClass on Spring MVC

    Quote Originally Posted by jonnyS
    1. Is there similar functionality in Spring that just does the above?
    not out of the box. a simple way to do it is to create a class
    formC {
    private formA;
    private formB;
    }

    and use it as your commandClass then you ould access your properties by expressions like formC.formA.field1, formC.formB.fieldX, etc.

    Quote Originally Posted by jonnyS
    2. Do I have to create a new set of form beans that only used for web layer, then move each properties to domain beans?
    Well that was answered by 'katentim' in previous post

    HTH
    Thanks,
    Alex.

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  3. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 2
    Last Post: Jan 21st, 2005, 04:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •