views:

61

answers:

1

I was reading i18n chapter from java blueprint and I came across this "the system default locale for a Web component is the Web container's default locale" (@ http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/i18n/i18n4.html).

I am wondering if there is anything like that. Also, I see that faces-config.xml provides the notion of "default-locale" and "supported-locale" concept. But why is this missing from web.xml?

+1  A: 

I'm not sure what you're asking here so I'm answering with the risk of completely missing the point.

The question in the title - "Where is Web Container's default locale defined?" - well, that's up to the Web Container's vendor. Each vendor (WebSphere, JBoss, WebLogic etc) may provide their own means of setting a "default locale" for the container, so you'll have to consult the documentation of your Web container. I wouldn't be surprised if some Web Containers don't have a way to set a "default locale" to begin with.

The second question - "I am wondering if there is anything like that" - is a bit unclear... if you meant what I think you meant, then the answer is above.

The third question - "why is this missing from web.xml?" - no particular reason that I know of, really. Remember, the format of web.xml is determined by the Servlet / JSP specification so items included there are items that the spec "drivers" felt should belong there.

Having said that, many Application Server (and Web Container) vendors provide their own "extensions" to the Servlet / JSP spec (for example, IBM WebSphere provides quite a few extensions). Typically, such "extra settings" are coded in additional XML files under WEB-INForMETA-INF` or a subdirectory thereof. It is possible that your Web Container provides means for the developer to specify a "default locale" at the Web Application level... but you'll have to consult the documentation for that (or provide information about your Web Container and we'll try to help you).

Isaac