Struts2-How to invoke restservice url through struts2 config file?
<p>I am working on RestService call. I integrated rest call with spring. And added the request mapping url-pattern in web.xml file. I am using struts2 with spring and mybatis technologies for develop the application.</p>

<pre><code>      I can access the application using requests  like 
    /localhost/sample/register/registerUser it works fine.

     My problem is i have to give the request to rest service call like url        /localhost/sample/navigation/statistic/artifact/1001).

    How to achieve this request. 

      I am getting the following warning.
    "No mapping found for HTTP request with URI [/artifact/*] in DispatcherServlet with name 'sitsStatisticService'".

    without struts config file using simple web.xml i got the solution. In this way i can directly give the request to url-pattern of servlet am getting the response.

    I am attaching files struts-config, web.xml file.

This file contains configuration of RestService.

    web.xml file
    ------------

    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;

        &lt;display-name&gt;Struts2_Spring_Ant Application&lt;/display-name&gt;

        &lt;welcome-file-list&gt;
            &lt;welcome-file&gt;/WEB-INF/jsp/index.jsp&lt;/welcome-file&gt;
        &lt;/welcome-file-list&gt;

        &lt;listener&gt;
            &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
        &lt;/listener&gt;
        &lt;listener&gt;
            &lt;listener-class&gt;
                org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
        &lt;/listener&gt;

        &lt;filter&gt;
            &lt;filter-name&gt;struts2&lt;/filter-name&gt;
            &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
        &lt;/filter&gt;

        &lt;filter-mapping&gt;
            &lt;filter-name&gt;struts2&lt;/filter-name&gt;
            &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
        &lt;/filter-mapping&gt;
        &lt;context-param&gt;
            &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
            &lt;param-value&gt;  
                /WEB-INF/applicationContext.xml  
            &lt;/param-value&gt;
        &lt;/context-param&gt;
        &lt;jsp-config&gt;
            &lt;taglib&gt;
                &lt;taglib-uri&gt;/struts-tags&lt;/taglib-uri&gt;
                &lt;taglib-location&gt;/WEB-INF/struts-tags.tld&lt;/taglib-location&gt;
            &lt;/taglib&gt;

        &lt;/jsp-config&gt;
        &lt;error-page&gt;
            &lt;error-code&gt;404&lt;/error-code&gt;
            &lt;location&gt;/WEB-INF/pages/404.jsp&lt;/location&gt;
        &lt;/error-page&gt;

        &lt;servlet&gt;
            &lt;servlet-name&gt;sitsStatisticService&lt;/servlet-name&gt;
            &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
            &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
        &lt;/servlet&gt;

        &lt;servlet-mapping&gt;
            &lt;servlet-name&gt;sitsStatisticService&lt;/servlet-name&gt;
            &lt;url-pattern&gt;/artifact/*&lt;/url-pattern&gt;
        &lt;/servlet-mapping&gt;

    &lt;/web-app&gt;


This file contains configurations of action classes and rest service call info.

    struts.xml file
    --------------


    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
    &lt;!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
         "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;

    &lt;struts&gt;
        &lt;constant name="struts.objectFactory.spring.autoWire" value="type"/&gt;
        &lt;constant name="struts.enable.DynamicMethodInvocation" value="false" /&gt;
        &lt;constant name="struts.devMode" value="false" /&gt;

        &lt;constant name="struts.ui.theme" value="simple" /&gt;
        &lt;constant name="struts.custom.i18n.resources" value="ApplicationResources" /&gt;

        &lt;package name="default" extends="struts-default" namespace="/"&gt;

        &lt;package name="register" namespace="/sample/register" extends="struts-default"&gt;

            &lt;action name="registerUser"&gt;
                &lt;result&gt;/WEB-INF/jsp/pantalla_registro01.jsp&lt;/result&gt;
            &lt;/action&gt;

            &lt;/package&gt;

        &lt;package name="navigation" namespace="/sample/navigation" extends="struts-default"&gt;
            &lt;action name="statistic"&gt;
                &lt;result&gt;/artifact/*&lt;/result&gt;
            &lt;/action&gt;   
        &lt;/package&gt;
    &lt;/struts&gt;
</code></pre>

<p>This file is the configuration of rest service servlet mapping configured in web.xml file.<br>
        sitsStatisticService-servlet-xml file
        --------------------------------------</p>

<pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:oxm="http://www.springframework.org/schema/oxm"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
                    http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd"&gt;

        &lt;context:component-scan base-package="com.sits.itv.webServices" /&gt;

        &lt;bean class="org.springframework.web.servlet.view.BeanNameViewResolver" /&gt;

        &lt;bean id="serviceMatrixXmlView"
            class="org.springframework.web.servlet.view.xml.MarshallingView"&gt;
            &lt;constructor-arg&gt;
                &lt;bean class="org.springframework.oxm.xstream.XStreamMarshaller"&gt;
                    &lt;property name="autodetectAnnotations" value="true"/&gt;
                &lt;/bean&gt;
            &lt;/constructor-arg&gt;
        &lt;/bean&gt;
    &lt;/beans&gt;


    Please any one help me in this issue.

    Thanks,
    Sreedhar.
</code></pre>
