local.jsp
来自「JAVAEE编程技术最好的源代码和课件下载。。。。。。。。」· JSP 代码 · 共 43 行
JSP
43 行
<%@page contentType="text/html; charset=UTF-8"%><%@page import="java.util.*"%><%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%><html><head><title>语言环境选择</title></head><body bgcolor="#ffffff"><c:if test="${param['locale'] != null}"> <fmt:setLocale value="${param['locale']}" scope="session"/> <fmt:setTimeZone value="${param['locale']}" scope="session"/></c:if><c:if test="${param['locale'] == null}"> <fmt:setLocale value="${header['locale']}" scope="session"/> <fmt:setTimeZone value="${header['locale']}" scope="session"/></c:if><% Locale crtl = Locale.getDefault(); Object cobj = session.getAttribute("javax.servlet.jsp.jstl.fmt.locale.session"); if (cobj != null && cobj instanceof Locale) { crtl = (Locale) cobj; } Locale[] la = java.text.NumberFormat.getAvailableLocales();%><form method="POST" action=""> 语言环境选择: <br /><select name="locale"><%for (int i = 0; i < la.length; i++) {%> <option value="<%=la[i]%>" <%if (la[i].equals(crtl)) { out.print("selected=\"selected\""); }%>><%= la[i].getDisplayName(crtl)%></option><% }%></select><br /><input type="submit" value="确定"/></form></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?