📄 getpostdata.java
字号:
/*
* Created on 2004-6-13
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package com.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author haoyulong
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class getpostdata extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
//TODO Method stub generated by Lomboz
//为解决编码问题后来添加
PrintWriter out = response.getWriter();
out.println( //a tools method to show the html code with title
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + "get post data " + "</H1>\n" +
"<UL>\n" +
" <LI><B>username</B>: "
+ request.getParameter("username") + "\n" +
" <LI><B>password</B>: "
+ request.getParameter("password") + "\n" +
"</UL>\n" +
"</BODY></HTML>");
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
//TODO Method stub generated by Lomboz
//为解决编码问题后来添加
doPost(request,response);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -