title: Spring MVC request with no view rendered
body: <p>I am having trouble with a Spring configuration for the following functionality - I need the view requests to behave normally (render the view) and the service requests to simply execute without rendering anything. 
  The problem I'm having is that, after the controller executes, somewhere down the line Spring decides that a ModelAndView should get instantiated even though the controller method doesn't return anything (void). This triggers a view to be rendered, when in fact I want to simply do nothing once the controller has done it's job. 
  I'm sure it must be something I'm doing wrong in the Spring configuration (my guess is that it's related to the view resolver). 
  Any help on this is appreciated. 
  Thanks. </p>
  
  <p>Here is the code: </p>
  
  <pre><code>@Controller
  @RequestMapping( "actions" )
  public final class ServiceController{
      private static final Logger logger = LoggerFactory.getLogger( ServiceController.class );
      @RequestMapping( value = "/submit.service",method = RequestMethod.POST )
      public void test( @RequestParam( "mail" ) String mail ){
          ServiceController.logger.info( mail );
      }
  }
  </code></pre>
  
  <p>And the servlets in web.xml: </p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;viewServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/spring/viewServlet-context.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;viewServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>The context is: </p>
  
  <pre><code>&lt;annotation-driven /&gt;
  &lt;beans:bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"&gt;
      &lt;beans:property name="resourceLoaderPath" value="/WEB-INF/velocity/" /&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"&gt;
      &lt;beans:property name="cache" value="true" /&gt;
      &lt;beans:property name="prefix" value="" /&gt;
      &lt;beans:property name="suffix" value=".vm" /&gt;
  &lt;/beans:bean&gt;
  </code></pre>