📄 resourcejstl.jsp
字号:
<%-- Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.--%><%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %><%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%@ page import='javax.servlet.jsp.jstl.core.*' %><%@ page import='javax.servlet.jsp.jstl.fmt.*' %><%@ page pageEncoding="UTF8" contentType="text/html" %><html><title> I18n Sample using JSTL 1.1</title><body bgcolor="#FFFFFF"><h1><font face="Times New Roman, Times, serif">JSTL 1.1 i18n sample</font></h1><p><%-- Check loc_name parameter in request object --%><c:choose> <c:when test='${not empty param.loc_name}'> <c:set var='locale' value='${param.loc_name}'/> </c:when> <c:otherwise> <c:set var='locale' value='<% java.util.Locale.getDefault() %>' /> </c:otherwise></c:choose><fmt:setLocale value='${locale}' scope='page'/><fmt:formatDate value='<%= new java.util.Date() %>' type='both' dateStyle='full' timeStyle='full'/><p><p><fmt:message key='pageLang'/><br><% String enc=response.getCharacterEncoding(); Object[] my_args={enc}; String msg_enc=LocaleSupport.getLocalizedMessage(pageContext,"pageEnc",my_args); out.print(msg_enc);%></p><hr align=left width=85%> <font face="Times New Roman, Times, serif"> Please select a language of your choice, thenclick on the submit button below.</font><p> <table cellspacing="0" cellpadding="1" width="350" bgcolor="#dddddd" border="0"> <tr> <td><b>Locales</b></td> </tr> <tr> <td> <%-- Since this form does not specify an action, this page will be reloaded when the form is submitted. --%> <form> <table cellspacing="0" cellpadding="2" width="100%" bgcolor="#ffffff" border="0"> <tr> <td valign="top" nowrap="nowrap"><small> <input type="radio" name="loc_name" value="ja">Japanese </small></td> </tr> <tr> <td valign="top" nowrap="nowrap"><small> <input type="radio" name="loc_name" value="ko">Korean </small></td> </tr> <tr> <td valign="top" nowrap="nowrap"><small> <input type="radio" name="loc_name" value="zh">Simplified Chinese </small></td> </tr> <tr> <td valign="top" nowrap="nowrap"><small> <input type="radio" name="loc_name" value="en">English </small></td> </tr> </table> </td> </tr></table> <p><input TYPE=SUBMIT NAME="i18n_submit" VALUE="Submit"></p></form> <p><font FACE="Thorndale, serif"><a HREF="/i18n-simple">Backto sample home</a></font></p><p STYLE="margin-bottom: 0cm"><font SIZE=1><font FACE="Verdana, Arial, Helvetica, sans-serif"><font COLOR="#000000">Copyright(c) 2004 Sun Microsystems, Inc. All rights reserved.</font></font></font></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -