Results 1 to 2 of 2

Thread: Inject into a Struts form bean?

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Edinburgh
    Posts
    10

    Default Inject into a Struts form bean?

    I've got a struts form bean defined like this:

    <form-bean name="itemForm" type="org.apache.struts.validator.DynaValidatorFor m">
    <form-property name="art" type="com.xxx.struts.ArtForStruts" />
    </form-bean>

    And struts creates an instance of ArtForStruts whenever the (Spring proxied) action is invoked.

    <action path="/EditItem" type="org.springframework.web.struts.DelegatingAct ionProxy"
    name="itemForm" scope="request" parameter="method" validate="false">
    <forward name="edit" path="/EditItem.jsp" contextRelative="true" />
    </action>

    Now i'd like to inject some dependencies into ArtForStruts. Am I right in thinking that the best (tm) way of doing this is to use a proxy in place of com.xxx.struts.ArtForStruts in the form-bean definition and then have ArtForStruts as the target? Would ProxyFactoryBean do the trick?

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM

Posting Permissions

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