Retrieve browser locale from httpsession?

后端 未结 3 1960
梦如初夏
梦如初夏 2021-01-22 10:19

Is it possible to derive the preferred language from a httpsession object (javax.servlet.http.HttpSession) ? It is possible to get it from the servletrequest but I dont have tha

3条回答
  •  一向
    一向 (楼主)
    2021-01-22 10:51

    As its Javadoc shows, there is no method which does exactly that.

    Either just obtain it from the request (preferred), or store it as an attribute of the session yourself.

提交回复
热议问题