runbat

set path=%java_Home%\bin
set classpath=jar包的路径;jar包的路径
javac *.java
pause




package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
pulic class Test extends HttpServlet{
 protected void doGet(HttpServletRequest request, HttpServletResponse response)
  throws ServletException,IOException{
           PrintWriter out=response.getWriter();
     out.println("<html><body><h3>This is a servlet test.</h3></body></html>");
     out.flush();
 }
}




<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 ******
-->

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">

  <description>
     A application for test
  </description>
<servlet>
<servlet-name>Test</servlet-name>
  <display-name>Test</display-name>
  <description>
     A test for servlet.
  </description>
<servlet-class>test.Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
</web-app>




 \myapp\WEB-INF\classes\test

posted on 2008-03-22 10:02 姜波 阅读(229) 评论(0)  编辑  收藏 所属分类: jsp


只有注册用户登录后才能发表评论。


网站导航:
 
<2008年3月>
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345

导航

统计

常用链接

留言簿(1)

随笔分类

随笔档案

website

搜索

最新评论

阅读排行榜

评论排行榜