title: httprequest not autowired in aspect
body: <p>I am intercepting calls to getDescription method of a certain class using following aspect.</p>
  
  <pre><code>@Aspect
  public class InternationalizationAspect {
  
      private static final String LANGUAGE_CODE_ENGLISH = "en";
      private static Logger log = LoggerFactory.getLogger(InternationalizationAspect.class);
  
      @Autowired
      InternationalizationService internationalizationService;
  
      @Autowired
      private HttpServletRequest httpServletRequest;
  
      @Around("execution(* com.***.***.***.***.getDescription(..))")
      public Object getInternationalizedTitleDescription(ProceedingJoinPoint joinPoint) throws Throwable {
          log.info("title getdescription intercepted");
          if (httpServletRequest == null) {
              log.info("http servlet request was not autowired correctly");
              return joinPoint.proceed();
          } else {
              Locale locale = httpServletRequest.getLocale();
              log.info("locale is = " + locale);
              if (locale.getLanguage().equals(new Locale(LANGUAGE_CODE_ENGLISH).getLanguage())) {
                  return joinPoint.proceed();
              } else {
                  log.info("getting internationalized description");
                  Title t = (Title) joinPoint.getTarget();
                  return internationalizationService.getTitleDescriptionFromTitleAndLocale(t, locale);
              }
          }
      }
  }
  </code></pre>
  
  <p>For the above aspect, I get following output:</p>
  
  <pre><code>title getdescription intercepted
  http servlet request was not autowired correctly
  title getdescription intercepted
  http servlet request was not autowired correctly
  title getdescription intercepted
  http servlet request was not autowired correctly
  title getdescription intercepted
  http servlet request was not autowired correctly
  </code></pre>
  
  <p>In my applicationContext.xml, I have:</p>
  
  <pre><code>&lt;bean id="internationalizationAspect" class="com.***.***.***.InternationalizationAspect" /&gt;
  &lt;context:component-scan base-package="com.***"&gt;
          &lt;context:exclude-filter expression=".*_Roo_.*" type="regex"/&gt;
          &lt;context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/&gt;
  &lt;/context:component-scan&gt;
  </code></pre>
  
  <p>Why is spring not autowiring httpservletrequest in my aspect. According to this answer: <a href="https://stackoverflow.com/questions/10541934/spring-aop-and-aspect-thread-safety-for-an-autowired-httpservletrequest-bean">Spring AOP and aspect thread safety for an autowired HTTPServletRequest bean</a></p>
  
  <p>it should work.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My web.xml resembles following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
  
      &lt;display-name&gt;Spring Web Application example&lt;/display-name&gt;
  
      &lt;!-- Configurations for the root application context (parent context) --&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;
              /META-INF/spring/applicationContext.xml
          &lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Configurations for the DispatcherServlet application context (child context) --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;spring-mvc&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/mvc/spring-mvc-servlet.xml
              &lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;spring-mvc&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/admin/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I am defining my aspect bean in applicationcontext.xml which is not in spring-mvc-servlet.xml</p>