当我的代码中没有ServletRequest.getLocale()并由JSF实现提供时,如何在JSF应用程序中使用Servlet?我正在尝试使用ServletContextListener,但是可以从ServletRequest到达ServletContextEvent吗?无论如何,正确的方法是什么? 最佳答案 FacesContext.getCurrentInstance().getExternalContext().getRequestLocale(); ?