[opencms-dev] multi-language pages in 5.3.4

Alexander Kandzior alex at opencms.org
Fri May 14 10:58:37 CEST 2004


Martin,

> [Problem description...]
> The problem is obviously that the fallback machanism should 
> use the prefered order of the user (Accept-Language) and not 
> the order specified in opencms-system.xml

You are of course right, I realized that while I was writing the response. 

> OK, that works perfectly, I have the LocaleHandler
> finished. I can send it to you for puuting it into CVS
> if you want.

Sure, please send me your file so I can add it to the CVS. 

> The only problem is when broser requests
> a directory, so some default index.(html|jsp)
> file is used. Then the page is null, I have to use
> default locales, which can meet the problem described above.
> 
> Is there a way to find the index file for a directory ?

Yes, like this:

// need to be initialized:
HttpServletReqest req;
HttpServletRespnse res;
Stirng vfsName;
CmsObject cms;

file = CmsFile.upgrade(OpenCmsCore.getInstance().initResource(cms, vfsName,
req, res), cms);

This will give you the index file of the directory, taking into account all
the settings. 

Please note: I probably will refactor/move this code to some new method in
the CmsObject in the future.


Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com





More information about the opencms-dev mailing list