ServletResponse 提供了 setLocale() 方法来修改尚未提交的响应的区域设置。 PortletResponse 不提供这样的方法,仅提供 getLocale() - 还有其他方法可以更改 portlet 请求/响应的区域设置吗?
最佳答案
没有。这在 portlet 中没有意义 - 它们只是聚合响应的一个组成部分。
Portlet 2.0 规范 (JSR 286) 证实了这一点:
The portlet cannot set the character encoding or the locale of the response as these are pre-set by the portal / portlet container.
关于java - Portletfilter 更改区域设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1812132/