I am trying to internationalize my website using JSTL 1.2 based on How to internationalize a Java web application?. Here is the beginning of the JSP file:
<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" />
<fmt:setLocale value="${language}" />
<fmt:setBundle basename="com.bundle.test" />
<html lang="${language}">
Here is the test.properties file:
login.label.username = Username
login.label.password = Password
login.button.submit = Sign in
login.label.direction = rlt
In the body, I include those lines:
<label for="username"><fmt:message key="login.label.username" /></label>
But when I open the JSP page in browser, it outputs like this:
???login.label.username???
I expected it to output the value "Username".
How is this caused and how can I solve it?