WEB开发网
开发学院WEB开发Xml 将 XML 数据导入 Google App Engine 阅读

将 XML 数据导入 Google App Engine

 2010-10-22 17:18:53 来源:WEB开发网   
核心提示: 清单 5. web.xml<?xmlversion="1.0"encoding="utf-8"?><web-appxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

清单 5. web.xml

<?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" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> 
  <servlet> 
  <servlet-name>CreateEmployeeServlet</servlet-name> 
  <servlet-class>com.xmlimport.servlet.CreateEmployeeServlet</servlet-class> 
  </servlet> 
  <servlet-mapping> 
  <servlet-name>CreateEmployeeServlet</servlet-name> 
  <url-pattern>/CreateEmployee</url-pattern> 
  </servlet-mapping> 
</web-app> 

清单 6 展示了这个 servlet。

清单 6. CreateEmployeeServlet.java

package com.xmlimport.servlet; 
 
import java.io.IOException; 
 
import javax.servlet.RequestDispatcher; 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
 
import com.xmlimport.employee.EmployeeHandler; 
 
public class CreateEmployeeServlet extends HttpServlet { 
 
  private static final long serialVersionUID = 1L; 
 
  public void doGet(HttpServletRequest request, HttpServletResponse response) 
    throws IOException, ServletException { 
 
    new EmployeeHandler(); 
    PrintWriter out = response.getWriter(); 
    out.println(“Employees Created”); 
 
 
  } 
 
 
} 

上一页  1 2 3 4 5 6 7 8 9 10  下一页

Tags:XML 数据 导入

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接