Announcement Announcement Module
Collapse
No announcement yet.
Spring-WS in a normal spring dispatcher servlet? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-WS in a normal spring dispatcher servlet?

    We're currently using a normal spring mvc setup. The dispatcher servlet is mapped to

    /*

    since the servlet container only serves request through spring mvc.

    Is it possible to use the mappers provided by spring-ws, such as PayloadRootQNameEndpointMapping, in a normal spring mvc context so that we don't have to have two dispatcher servlets and the (possible) servlet mapping nightmare in web.xml.

    If not, are there any good tips how to fit this (spring-ws) into our application without having to change our current url:s and without having to do a ton of work in web.xml?

    There are possible "roots" that are free such as /ws/* but is it well defined how servlet containers would handle mappings such as

    /ws/* => wsDispatcherServlet
    /* => mvcDispatcherServlet (want to map everything not going into wsDispatcherServlet to this servlet)

    ?

  • #2
    Yes, you can use a MessageDispatcher in a standard DispatcherServlet. In fact, the MessageDispatcherServlet is just a convenience class. It involves adding a few extra handler adapters. Look at the airline sample to see how it is done. Note that the Spring DispatcherServlet loses the default adapters when you add extra handler adapters, so if you want to run controllers and a message dispatcher in the same servlet, you should define a SimpleControllerHandlerAdapter, which supports your controllers.

    In the end, however, I think it's easier to define two servlets, one for /*, and one for /services/* (which is the standard, I guess).

    Comment


    • #3
      Ok. Sounds like we'll go down the double dispatcher route then. I was unsure how servlet containers handled overlapping mappings like that but if you say it's the standard way I beleive you.

      Thank's a lot. It'll be very interesting to work with spring-ws. Been doing Spring for a very looooong time and if spring-ws is just half as good it'll be wonderful

      Comment

      Working...
      X