title: How to access applicationContext from a Controller
body: <p>I'm using a Spring MVC Project from Netbeans and I've moved the applicationContext.xml file to /src/conf because I've read WEB-INF isn't the correct folder. I can't access to the application context from a controller in /src/java/web/controller. I've tried several ways and it doesn't deploy the project.</p>
  
  <p>I would like a link to learn more about paths in a web project, pleas.</p>
  
  <p>I think this could help us to figure out:</p>
  
  <pre><code>public class TasksController implements Controller {
  private TaskManager taskManager;
  protected final Log logger = LogFactory.getLog(getClass());
  
  public TaskController() {
      ApplicationContext context = new FileSystemXmlApplicationContext("/WEB-INF/applicationContext.xml");    
      taskManager = (TaskManager)context.getBean("taskManager");
  }
  
  @Override
  public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse res) 
      throws ServletException, IOException {
  
      logger.info("Returning view from TaskController");
  
      Map&lt;String,Object&gt; tasks = new HashMap&lt;String,Object&gt;();
  
  // Get tasks from model
  
      return new ModelAndView("tasks","tasks",tasks);
  }
  </code></pre>
  
  <p>Bye!</p>