title: Inject specific beans as parameters in function with multiple parameters
body: <p>I understand that i can use @Autowired to inject a bean in a class.</p>
  
  <p>Now i get curious::
  I don't want to have a private attribute with @Autowired.
  I have a function in my controller and i want to inject bean  as parameters directely in the function.
  I got an error saying that file and token are not beans.</p>
  
  <p>Is there a way to autowire or inject just the beans i need as parameters ?</p>
  
  <pre><code>@Controller
  public class SpinalToolboxWebController {
  
      /*@Autowired
      private FileOperationsService fileOperationsService;
  
  
      @Autowired
      private Comparator&lt;String&gt; comparator;
  
      @Autowired
      private ServerResponse serverResponse;
  
      @Autowired
      private SoftwareCommunicationService softwareCommunicationService;
  
      @Autowired
      private StringBuffer stringBuffer;
  
      @Autowired
      private UserEnvironmentService userEnvironmentService;*/
  
  
      @Autowired
      @RequestMapping(value="/upload", method = RequestMethod.POST, produces="application/json")
      public  @ResponseBody
      ServerResponse handleUploadedFiles(@RequestParam(value = "file") MultipartFile file,
                                         @RequestParam(value="token") String token, 
                                         SoftwareCommunicationService softwareCommunicationService,
                                         FileOperationsService fileOperationsService, 
                                         ServerResponse serverResponse )throws IOException {
  
          System.out.println("Passing throught upload controller");
  
          if(!fileOperationsService.isUploadedFileExtensionAllowed(file.getOriginalFilename()))
          {
              serverResponse.setUndefinedResponse();
              return serverResponse;
          }
  
          if(fileOperationsService.uploadFile(file, token)){
              serverResponse.setResponse(file, softwareCommunicationService.generateRawAndHeader(file));
          }
          else{
              serverResponse.setUndefinedResponse();
          }
          return serverResponse;
      }
  
  }
  </code></pre>