📄 local.jsp
字号:
<%@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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -