Read the properties file in the JSP and set the value to the JS variable:
Web_stderr.properties file contents: [XHTML] view plain copy common.username.error.null = username can is not null. Common.username.error.invalid = Username is invalid. Common.password.error.null = password can not bu null. Common.password.error.invalid = password is invalid. Common.login.error.user = The user can not been stored or password is wrong. Common.request.parameter.error = Request parameter error. Common.function.title.null = the tilte of function or is null. Common.session.timeout = The session has already expired. Please login again.
1. The JS variable for storing the content of the properties file (common-checkmessage.jsp):[XHTML] View plain copy <%@ page language= "java" contenttype= "Text/html; charset=utf-8" pageencoding= "UTF-8" import= "Java.util.ResourceBundle"%> < ! doctype html public "-//w3c//dtd html 4.01 transitional//en" "http:// Www.w3.org/TR/html4/loose.dtd ">
You can use these variables in your JSP and JS files as long as you include the JSP file in other JSPs.