Announcement Announcement Module
Collapse
No announcement yet.
Spring 3.2 Java Config Example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3.2 Java Config Example

    I'm was looking at moving away from the xml config and removing web.xml elements and wanted to see if someone has a good example of how to configure the Spring WS @Bean and also the servlet elements in the WebApplicationInitializer code. If this is not possible right now I can create a JIRA enhancement request to see if this can be added in a future release.

    Thanks

  • #2
    I worked a little with support on this one and right now MessageDispatcherServlet does not have a way of passing in rgw root context. For the normal Spring MVC DispatcherServlet there is a constructor with a WebApplicationContext parameter (added in 3.1.x I believe) and the 'root' app context can be passed on using this parameter.

    However it looks like you can use the web.xml to bootstrap the ability to support other JavaConfig classes if you want like me to still have the persistance and service logic as pure Java configuration. There is the syntax of this below and I'll open a request to enhance this support if a future release.

    <servlet>
    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.Messag eDispatcherServlet</servlet-class>
    <init-param>
    <param-name>transformWsdlLocations</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>contextClass</param-name>
    <param-value>
    org.springframework.web.context.support.Annotation ConfigWebApplicationContext
    </param-value>
    </init-param>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>org.springframework.ws.samples.echo.code_app roach.SpringWSConfig</param-value>
    </init-param>
    </servlet>

    Comment

    Working...
    X