⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urlrewrite2.java

📁 j2ee编程技术中的一些代码
💻 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 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 URLRewrite2 extends HttpServlet {
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		//TODO Method stub generated by Lomboz
		 request.setCharacterEncoding("gb2312");
	        response.setContentType("text/html;charset=gb2312");
	       
	        java.io.PrintWriter out = response.getWriter( );

	        String contextPath = request.getContextPath( );

	       
	        out.println("<html>");
	        out.println("<head>");
	        out.println("<title>URL Rewriter</title>");  
	        out.println("</head>");
	        out.println("<body>");
	        out.println(
	        "<h1>URL重写演示:接收参数</h2>");

	        out.println("下面是接收的参数:<br>");
	        out.println("name="+request.getParameter("name"));
	        out.println("age="+request.getParameter("age"));
	        out.println("</body>");
	        out.println("</html>");

	}
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		//TODO Method stub generated by Lomboz
		 doGet(request,response);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -