1.表格的隔行间色显示
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>表格的隔行间色显示</title>
<style type="text/css">
.odd{
background-color: orange;
}
.even{
background-color: yellow;
}
tr:HOVER {
background-color: red;
}
</style>
</head>
<body>
<hr color="orange"/>
<%
List list = new ArrayList();
list.add("aa");
list.add("bb");
list.add("cc");
list.add("dd");
list.add("ee");
list.add("ff");
list.add("gg");
request.setAttribute("list",list);
%>
<table border="1px" width="40%">
<c:forEach var="str" items="${list}" varStatus="status">
<tr class=${status.count%2==0 ? 'odd' : 'even' }><td>${str}</td><td>${status.count }</td></tr>
</c:forEach>
</table>
<hr color="red"/>
</body>
</html>
![](https://img-my.csdn.net/uploads/201211/21/1353491107_8648.png)
2.国际化处理页面。
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化处理页面</title>
</head>
<body>
<%
ResourceBundle rb=ResourceBundle.getBundle("com.hbsi.resource.Myproperties",request.getLocale());
%>
<form action="" style="color: red">
<%=rb.getString("username")%><input type="text"name="username"/><br/>
<%=rb.getString("password")%><input type="text"name="password"/><br/><br/>
<input type="submit" value="<%=rb.getString("submit")%>"/>
<input type="reset" value="<%=rb.getString("reset")%>"/>
</form>
</body>
</html>
Myproperties.properties
username=username
password=password
submit=submit
reset=reset
Myproperties_zh.properties
username=\u7528\u6237\u540D\uFF1A
password=\u5BC6\u7801\uFF1A
submit=\u63D0\u4EA4
reset=\u91CD\u7F6E
Myproperties_en.properties
username=username\uFF1A
password=password\uFF1A
submit=submit
reset=reset