GET /intro.html HTTP/1.0
User-Agent: Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
Accept: image/gif, image/jpeg, text/*, */*
Accept-language : zh
Accept-Charset: iso-8859-1
|
protected void insertproc(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException{
Locale reqLocal = req.getLocale();
System.out.println("The country is :" + reqLocal.getCountry());
System.out.println("The language is :" + reqLocal.getLanguage());
|
[06-3-10 14:56:32:516 CST] 6ce078f9 SystemOut
O The country is :CN
[06-3-10 14:56:32:516 CST] 6ce078f9 SystemOut
O The language is :zh
|
Date: Saturday, 23-May-98 03:25:12 GMT
Server: JavaWebServer/1.1.1
MIME-version: 1.0
Content-type: text/html; charset=UTF-8
Content-length: 1029
Last-modified: Thursday, 7-May-98 12:15:35 GMT
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>example.html</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
|
protected void insertproc(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException{
resp.setContentType("text/html;charset=UTF-8");
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<HTML>
<HEAD>
<TITLE>insertdb.jsp</TITLE>
</HEAD>
<BODY>
<P>
<FORM METHOD=POST ACTION="./InsertDbProcDs">
<TABLE>
<TR>
<TD>Name:</TD>
<TD><input type="text" name="col2" value=""></TD>
<TR>
<TD><INPUT type="submit" value="submit"></TD>
</TR>
</TR>
</TABLE>
</RORM>
</P>
</BODY>
</HTML>
|
protected void insertproc(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException{
String test1 = req.getParameter("col2");
PrintWriter out = resp.getWriter();
resp.setContentType("text/html;charset=UTF-8");
out.println("<HTML>");
out.println("The input is " + test1);
out.println("</HTML>");
|
protected void insertproc(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException{
String test1 = req.getParameter("col2");
PrintWriter out = resp.getWriter();
//resp.setContentType("text/html;charset=UTF-8")
out.println("<HTML>");
out.println("The input is " + test1);
out.println("</HTML>");
|