English 中文(简体)
界定用户的首选语文
原标题:Determening the preferred language for the user

我有一个英文和瑞典文的网址,供用户使用。我的问题是:我如何决定向用户显示何种语言(以及数字格式等)。

javax.servlet.servlet.serverlet request 定义了 get Lolicale () <() ] 的方法, 并说它将根据HTTP 请求中的 接受语言 信头返回本地。 但是这意味着, 如果有德国浏览器的人访问我的网站, 则德国人将使用 locale object。 由于我的网站不支持德语, 请求中的本地将无法匹配任何语言文件 。

是否有方法配置此选项, 或者我是否需要推翻 get Lolicale () 方法的功能来做到这一点?

是否将Locale() () 改为正确的方法, 用以确定哪种语言对用户不满意, 或者该方法应该用于其他目的?

坦白地说,我想要的是:如果浏览器提供的地方得到我网站的支持,那么就用这个网站。否则,在我的网站(英文)上使用默认的(默认的 ) 。

最佳回答
问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签