In case you need to access the context from within a HttpServlet which itself is not instantiated by Spring (and therefore neither @Autowire nor ApplicationContextAware will work)...
WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
or
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
As for some of the other replies, think twice before you do this:
new ClassPathXmlApplicationContext("..."); // are you sure?
...as this does not give you the current context, rather it creates another instance of it for you. Which means 1) significant chunk of memory and 2) beans are not shared among these two application contexts.