Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Include html pages with various langs in a jsp page

843836Jun 20 2004 — edited Sep 5 2004
Hi
I build an internationalized web site with struts... it works great.
My problem is that i think it is not practical to use <bean:message ...> for large text pages (like "Terms of Use" page) - think of the problematic text value size of the attribute in the properties file...
So i build a "wrapper jsp" that include the correct html according to the user language, here it is:
//suppose i have terms_en.html, terms_ru.html, terms_iw.html files...
<%@ page contentType="text/html;charset=UTF-8" import="java.util.Locale,org.apache.struts.Globals" %>
<%	String p=request.getParameter("page");  //page=terms
	String lang=((Locale)session.getAttribute(Globals.LOCALE_KEY)).getLanguage();
	String path="/"+p+"_"+lang+".html";
%>
<html:html locale="true">
<head>
	<html:base />
	<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body dir="<bean:message key="dir" />">
...
<jsp:include page="<%=path%>" flush="false" />
...
</body>
</html:html>
Now, it works just fine with english and my default locale, i.e the locale defined in the "Regional Settings" at the control panel. other languages are displayed incorrectly and if i want to see a language correctly then i have to change the default locale in the "Regional Settings" at the control panel.

Is there any way to solve my problem?
I'm ready to hear any suggestions... if you have other way than include...

thanks A LOT
Mamtz
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2004
Added on Jun 20 2004
6 comments
283 views