[opencms-dev] CmsProperty class the correct choice to set a property?

Jan Meier jan.meier at zmnh.uni-hamburg.de
Fri Sep 1 09:17:58 CEST 2006


Hi,

Am Donnerstag 31 August 2006 16:06 schrieb Christian Steinert:
> > > CmsProperty represents properties as they are stored in the database.
> > > If you want to set the locale for one request only, then you could
> > > append the __locale=xx parameter to your URL.
> >
> > I know about the possibility to set the locale with __locale=xx, the
> > problem is that it is hard to memorize. The people who edit pages in my
> > OpenCms setup should create links to english content, for them it would
> > be a lot easier if they just have to append locale=xx to the link url.
> >
> > You said that CmsProperty is not the right choice to set the locale, how
> > can I set the locale within my jsp-code?
>
> I would like to understand how your JSP would know which locale should be
> used for a given request. Do you implement accept-language parsing or is
> the language somehow related to the url?

The language should be set in the Query-String, for 
example /index.html?lang=de

So that I can write:

String lang = request.getParameter("lang");

if (lang != null) 
	if (lang.equals("de")) {
		// here should the locale be set
	}

Regards 

Jan



More information about the opencms-dev mailing list