title: How to add a constructor in Controller via Spring
body: <p>I want to initialize three properties (<code>companyTypes</code>, <code>carrierLists</code>, and <code>cabinLevels</code>) as global variables:</p>
  
  <pre><code>@Controller
  @RequestMapping("/backend/basic")
  public class TicketRuleController {
      @Autowired
      private CarrierService carrierService;
      @Autowired
      private CabinLevelService cabinLevelService;
      @Autowired
      private CompanyTypeService companyTypeService;
      private List&lt;DTOCompanyType&gt; companyTypes = companyTypeService.loadAllCompanyTypes();
      private List&lt;DTOCarrier&gt; carrierLists = carrierService.loadAllCarriers();
      private List&lt;DTOCabinLevel&gt; cabinLevels = cabinLevelService.loadAllCabinLevel(); 
      ...
  }
  </code></pre>
  
  <p>How can I do this?</p>