title: My @Autowired service always null when I give no value for @RequestMapping
body: <p>I have a JSP page that called a method from a controller in my Hibernate project</p>
  
  <p><strong>Here's some of my code in JSP page:</strong></p>
  
  <pre><code>...
  &lt;jsp:useBean id="acl" scope="request" class="com.angelina.token.controller.AccessControlListsController"/&gt;
       ...
              &lt;c:if test="&lt;c:if test="${acl.allowView(session,7)}"&gt;"&gt;
              &lt;a style="font-size:12px;" href="&lt;c:url value="/admin/account/"/&gt;"&gt;Account Balance&lt;/a&gt;
              &lt;/c:if&gt;
       ...
  </code></pre>
  
  <p><strong>Here's some of my Controller</strong></p>
  
  <pre><code>...
  @Autowired
  private AccessControlListsService aclService;
  @Autowired
  private UsersService usersService;
  ...
  @RequestMapping(value="")
  @ResponseBody
  public boolean allowView(HttpSession session, Integer permissionId) throws Exception {
          Authentication auth = SecurityContextHolder.getContext().getAuthentication();
          String userName = auth.getName();
          Users users = usersService.findByUserName(userName).get(0);
          Integer roleId = users.getRoles().getId();
          Boolean status = aclService.getByRoleIdAndPermissionId(roleId, permissionId).getCanView();
          return status;
  }
  ...
  </code></pre>
  
  <p><code>usersService</code> is an Service object when I called method <code>allowView(HttpSession session, Integer permissionId)</code> from a JSP page <code>usersService</code> always return null.</p>
  
  <p><strong>Does Anyone have any idea on what should I do so that my object service not return null?</strong></p>
  
  <p>I really appreciate any help.</p>