Results 1 to 2 of 2

Thread: Spring - Struts (action-servlet.xml) settings

  1. #1

    Default Spring - Struts (action-servlet.xml) settings

    I'm using Spring on my Struts based web layer. All my actions currently extend Struts' MappingDispatchAction,,
    Is it possible somehow to map beans (in action-servlet.xml) for single action class instead of action name?

    for example, I have
    Code:
    <bean name="/admin/editUser,/admin/saveUser,/admin/listUsers,/admin/deleteUser,/listUserDetails" class="foo.bar.struts.action.UserDispatchAction" singleton="false">
      <property name="service">
        <ref bean="userAccountService"/>
      </property>
    </bean>
    I'd like something like
    Code:
    <bean class="foo.bar.struts.action.UserDispatchAction" singleton="false">
      <property name="service">
        <ref bean="userAccountService"/>
      </property>
    </bean>

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

    Default

    You need to provide an implementation of AbstractHandlerMapping to control the routing of requests to handler objects. Default is BeanNameUrlHandlerMapping.
    You can use SimpleUrlHandlerMapping or create your own implementation.
    Omar Irbouh

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

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: 3
    Last Post: Jun 4th, 2008, 06:45 PM
  3. Replies: 4
    Last Post: Aug 1st, 2005, 03:45 PM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 2
    Last Post: Aug 26th, 2004, 08:55 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
  •