Announcement Announcement Module
Collapse
No announcement yet.
Inject into a Struts form bean? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Take alook at Getting the ApplicationContext in the Struts Form
    HTH

    Comment

    Working...
    X