jsp+java类+servlet实现文件读取、写入的功能(三)

作者:袖梨 2022-07-02

本文是根据tomcat平台下实现而做,文件目录为:
tom_homewebapps ews下:
└html
└WEB-INF
└classes
└com
└FileMan.class
└FileServlet.class
└web.xml
下面开始修改web.xml令filesevelet生效/*

PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.***sun.com/dtd/web-app_2_3.dtd">

Welcome to Tomcat

Welcome to Tomcat



org.apache..index_jsp
org.apache.jsp.index_jsp



org.apache.jsp.index_jsp
/index.jsp


FileServlet
com.FileServlet


FileServlet
/servlet/FileServlet



在浏览器中输入:http://l*ocalh*o*st:8080/news/servlet/FileServlet
OK,出现以下面面:同时 在newshtml下可以找到test.htm,OK,成功!

相关文章

精彩推荐