Seems fine with me.

CRANFORD, CHRIS wrote:
> 
>   <!-- actions -->
>   <bean id="personAction" scope="prototype"
> class="com.company.app.struts2.actions.PersonAction">
>     <constructor-arg ref="personService"/>
>   </bean>
> 

I don't see any advantage on creating Actions with Spring. It works fine
without it and it seems unnecessary configuration. Perhaps someone else can
point out clear advantages of this.


CRANFORD, CHRIS wrote:
> 
> Per one example I saw, struts.xml should be as follows:
> 
>   <package name="persons" namespace="/persons" extends="struts-default">
>     <action name="list" class="personAction" method="list">
>       <result name="success">/WEB-INF/pages/persons/list.jsp</result>
>     </action>
>   </package>
> 

I would suggest using wildcards to reduce the configuration of your actions,
and also giving your actions a better name for when you have more than one
domain class (otherwise you don't know if "list" is related to Person or to
Address). For example:

  <package name="persons" namespace="/persons" extends="struts-default">
    <action name="*-*" class="{1}Action" method="{2}">
      <result name="success">/WEB-INF/pages/{1]/{2}.jsp</result>
    </action>
  </package>
This example would allow any action named Something-someaction to be mapped
to  method someaction of class SomethingAction and have a result of
pages/Something/someaction
-- 
View this message in context: 
http://old.nabble.com/Struts2-%2B-Spring-Hibernate-tp26329368p26333817.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to