getServletContext()
public class LoginAction extends AbstractController{ @Override protected ModelAndView handleRequestInternal(HttpServletRequest arg0, HttpServletResponse arg1)throws Exception{ WebApplicationContext context = getWebApplicationContext(); context.getServletContext(); //獲取ServletContext物件 return null; } }