java_web/webapp/hello.jsp

33 lines
982 B
Plaintext
Raw Permalink Normal View History

2024-11-26 15:35:29 +08:00
<%-- <%@ page language="java" contentType="text/html; charset=UTF-8" --%>
<%-- pageEncoding="UTF-8"%> --%>
<!-- <!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>A Simple JSP page</title> -->
<!-- </head> -->
<!-- <body> -->
<!-- <h3>Hello,World!</h3> -->
<!-- <font color="#0000ff"> -->
<%-- The time now is:<%=new java.util.Date()%> --%>
<!-- </font> -->
<!-- </body> -->
<!-- </html> -->
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page errorPage="errorHandler.jsp" %>
2024-11-25 19:06:50 +08:00
<html>
<body>
2024-11-26 15:35:29 +08:00
<%
String name = request.getParameter("name");
if (name == null) {
throw new RuntimeException("û<><C3BB>ָ<EFBFBD><D6B8>name <20><><EFBFBD>ԡ<EFBFBD>");
} else {
// <20><><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>name<6D><65><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD>
name = new String(name.getBytes("iso-8859-1"), "gb2312");
}
%>
Hello, <%= name %>
2024-11-25 19:06:50 +08:00
</body>
2024-11-26 15:35:29 +08:00
</html>