jsp/js读取properties文件的方法
来源:互联网 发布:landsat5数据预处理 编辑:程序博客网 时间:2024/06/03 12:29
jsp中读取properties文件,并把值设到js变量中:
web_stderr.properties文件内容:
- common.username.error.null = UserName can not be 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.存储properties文件内容的js变量(common-checkmessage.jsp):
- <%@ 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">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title></title>
- <%ResourceBundle res = ResourceBundle.getBundle("web_stderr"); %>
- <mce:script type="text/javascript"><!--
- var check_message_username_null = '<%=res.getString("common.username.error.null")%>';
- var check_message_username_invalid = '<%=res.getString("common.username.error.invalid")%>';
- var check_message_password_null = '<%=res.getString("common.password.error.null")%>';
- var check_message_password_invalid = '<%=res.getString("common.password.error.invalid")%>';
- // --></mce:script>
- </head>
- <body>
- </body>
- </html>
此时只要在其他jsp中包含该jsp文件,就可以在jsp和js文件中使用这些变量。
- jsp/js读取properties文件的方法
- js、jsp读取properties
- 读取properties文件的方法
- 读取Properties文件的方法
- jsp读取properties文件
- jsp中读取properties文件 (jsp中读取properties文件,并把值设到js变量中)
- jsp中读取properties文件
- jsp中读取properties文件
- jsp中读取properties文件
- 读取资源文件的方法 ApplicationResources.properties
- 读取Properties文件的几种方法
- 使用J2SEAPI读取Properties文件的方法
- 读取Properties文件的几种方法
- 六种读取Properties文件的方法
- 读取Properties文件的六种方法
- java 读取 properties文件的各种方法
- 读取Properties文件的六大方法
- Java读取.properties文件的方法
- group by 子句oracle实现
- 埃及12岁少年谈政治走红 网友称其当总统的料
- 【json】android json解析及简单例子
- 解决能上QQ却不能上网的问题
- 【Oracle】-【SNIPED和KILLED】-SPINED和KILLED的session清理流程
- jsp/js读取properties文件的方法
- FVC-going: on-line evaluation of fingerprint recognition algorithms
- android notification的正确使用
- 舞台系统 后台图片改变但是 前台出现图片不正确问题以及解决方法
- 设计模式原来如此-代理模式(Proxy Pattern)
- UVA 784 Maze Exploration
- 经典之言
- mysql查询今天、昨天、7天、近30天、本月数据
- HIbernate login this.hibernateTemplate.find("from User where username=? and password=?",new Object[