Hi,mine would be something like this and its working fine
How can I get a simple Internationalization tag work. I use the following JSP:
<[EMAIL PROTECTED] contentType="text/html"%> <[EMAIL PROTECTED] pageEncoding="UTF-8"%>
<%-- I18N Formatting --%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<html>
<head><title>Localized JSP Page</title></head>
<body>
<p>
Sample localized message: <fmt:bundle basename="index">
<fmt:message key="hello_world"/>
</fmt:bundle>
</p>
</body>
</html>
I put a index.properties containing a hello_world key in the root of my war and in WEB-INF/classes, But I obtain the following stack trace:
org.apache.jasper.JasperException: jsp.error.beans.property.conversion
org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManage
r(JspRuntimeLibrary.java:931)
org.apache.jsp.index_jsp._jspx_meth_fmt_message_0(index_jsp.java:119)
org.apache.jsp.index_jsp._jspService(index_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:305)
Can anyone help ?
Cheers.
#WEB-INF/classes/index.properties test.hello=Hello
#WEB-INF/classes/index_en.properties test.hello=Hello
#WEB-INF/classes/index_jp.properties test.hello=Moshi moshi
#test.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sess" uri="http://jakarta.apache.org/taglibs/session-1.0" %>
<sess:existsAttribute name="lang">
<fmt:setLocale value="${sessionScope.lang}" scope="session"/>
</sess:existsAttribute><fmt:bundle basename="index">
<fmt:message key="test.hello"/>
</fmt:bundle>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
