概括的介绍java及其网络开发
源代码在线查看: first.java
/* 范例名称:Servlet应用举例 * 源文件名称:First.java / first_servlet.html * 要 点:Servlet的基本结构及运行机制 */ import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class First extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String firstName,lastName; firstName = request.getParameter("firstname"); lastName = request.getParameter("lastname"); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(""); out.println(""); out.println("" + "FirstServlet" + ""); out.println(""); out.println(""); out.println(""); out.println("Welcome," + firstName+lastName + ""); out.println(""); out.println(""); } }