I don't understand quite well how to configure web.xml file for Spring Http Invoker if I have a java config.
Here is config:
@Configuration
@Import(JdbcConfiguration.class)
@EnableWebMvc
public class HttpInvokerConfig {
@Bean
public HttpInvokerServiceExporter contactExporter(){
HttpInvokerServiceExporter contactExporter = new HttpInvokerServiceExporter();
contactExporter.setServiceInterface(ContactDao.class);
return contactExporter;
}
@Bean
public HttpInvokerProxyFactoryBean remoteContactService(){
HttpInvokerProxyFactoryBean remoteContactService = new HttpInvokerProxyFactoryBean();
remoteContactService.setServiceUrl("http://localhost:8080/experimental/ContactService");
remoteContactService.setServiceInterface(ContactDao.class);
return remoteContactService;
}
}
Here web.xml:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>Spring HTTP Invoker Sample</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>contactExporter</servlet-name>
<servlet-class>
org.springframework.web.context.support.HttpRequestHandlerServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>contactExporter</servlet-name>
<url-pattern>/remoting/ContactService</url-pattern>
</servlet-mapping>
</web-app>
What do I need to specify in context-param instead of path to xml and is it possible to run the invoker without web.xml(like servlet 3.0 spec)?