xml-java-servlet
来源:互联网 发布:网络实施方案 编辑:程序博客网 时间:2024/05/16 02:48
<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312"%>
<!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=ISO-8859-1">
<title>Insert title here</title>
</head>
<font size="2">
<form action="AcceptForm" method="post">
姓名:<input type="text" name="name"/><br>
省份:<input type="text" name="province"><br>
<input type="submit" value="提交">
</form>
</font>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>test03</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Helloworld</servlet-name>
<servlet-class>sss.Helloworld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Helloworld</servlet-name>
<url-pattern>/AcceptForm</url-pattern>
</servlet-mapping>
</web-app>
package sss;
import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class Helloworld
*/
@WebServlet("/Helloworld")
public class Helloworld extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Helloworld() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Hello World!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello World!</h1>");
out.println("</body>");
out.println("</html>");
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
- xml-java-servlet
- java web.xml配置servlet
- java web.xml配置servlet
- java web.xml配置servlet
- Java web.xml配置 servlet
- Servlet、URL、XML、GUI、Java Applet、CGI
- java web.xml listener filter servlet
- java Web.xml中servlet配置方法
- Java Servlet 配置文件 web.xml 详解
- Java Web 应用web.xml配置 --Servlet映射配置
- JAVA Servlet 简单实例和web.xml常用的配置
- java web.xml listener servlet 和filter的加载顺序
- Java EE使用Servlet获取web.xml中的参数
- Java开发框架--spring-servlet.xml 配置详解
- java EE开发之Servlet第五课:xml解析
- Java Servlet学习【1】编写Servlet程序,配置web.xml,使用免安装版tomcat
- java web中web.xml中<servlet>和<servlet-mapping>的理解
- Java EE 项目 Servlet web.xml web-app节点头部信息,web-fragment.xml
- Struts2
- Linux stdin stdout stderr重新定向与管道
- java中Logger.getLogger(Test.class)
- Android--socket 发送广播的那些坑
- 实现上拉加载更多的SwipeRefreshLayout
- xml-java-servlet
- 新手编程导论
- android:drawableXXX图片和文字的距离控制
- 查看UserAgent的方法
- Hibernate
- android 自定义表盘控件
- webView与navigationController公用返回键
- 322. Coin Change
- sql 的update中使用case when