资源简介
在jsp页面文本框中输入数据,根据输入的指定网址,在页面中获取到源码,或者直接根据网址显示网页

代码片段和文件信息
package com.jhf.Control;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jhf.Model.WebPageSource;
public class PcServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public PcServlet() {
super();
}
/**
* Destruction of the servlet.
*/
public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}
/**
* The doGet method of the servlet.
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
doPost(request response);
}
/**
* The doPost method of the servlet.
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
response.setContentType(“text/html;charser=utf-8“);
request.setCharacterEncoding(“utf-8“);
PrintWriter out = response.getWriter();
String input=request.getParameter(“input“);
WebPageSource w=new WebPageSource();
BufferedReader reader=w.TestCopyUrl(input);
String line=null;
while((line=reader.readLine())!=null){
System.out.println(line);
out.println(line+“\n“);
}
out.flush();
out.close();
}
/**
* Initialization of the servlet.
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 529 2019-04-28 08:13 PaChongWeb\.classpath
文件 303 2019-04-28 08:14 PaChongWeb\.myme
文件 1753 2019-04-28 08:30 PaChongWeb\.project
文件 500 2019-04-28 08:14 PaChongWeb\.settings\.jsdtscope
文件 364 2019-04-28 08:13 PaChongWeb\.settings\org.eclipse.jdt.core.prefs
文件 468 2019-04-28 08:13 PaChongWeb\.settings\org.eclipse.wst.common.component
文件 252 2019-04-28 08:14 PaChongWeb\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2019-04-28 08:14 PaChongWeb\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2019-04-28 08:14 PaChongWeb\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 2376 2019-04-28 09:05 PaChongWeb\src\com\jhf\Control\PcServlet.java
文件 1158 2019-04-28 09:06 PaChongWeb\src\com\jhf\Model\WebPageSource.java
文件 2695 2019-04-28 09:33 PaChongWeb\WebRoot\index.jsp
文件 36 2019-04-28 08:13 PaChongWeb\WebRoot\me
文件 2182 2019-04-28 09:05 PaChongWeb\WebRoot\WEB-INF\classes\com\jhf\Control\PcServlet.class
文件 1627 2019-04-28 09:06 PaChongWeb\WebRoot\WEB-INF\classes\com\jhf\Model\WebPageSource.class
文件 834 2019-04-28 08:21 PaChongWeb\WebRoot\WEB-INF\web.xm
目录 0 2019-04-28 08:21 PaChongWeb\WebRoot\WEB-INF\classes\com\jhf\Control
目录 0 2019-04-28 08:22 PaChongWeb\WebRoot\WEB-INF\classes\com\jhf\Model
目录 0 2019-04-28 08:18 PaChongWeb\WebRoot\WEB-INF\classes\com\jhf
目录 0 2019-04-28 08:21 PaChongWeb\src\com\jhf\Control
目录 0 2019-04-28 08:22 PaChongWeb\src\com\jhf\Model
目录 0 2019-04-28 08:18 PaChongWeb\WebRoot\WEB-INF\classes\com
目录 0 2019-04-28 08:18 PaChongWeb\src\com\jhf
目录 0 2019-04-28 08:18 PaChongWeb\WebRoot\WEB-INF\classes
目录 0 2019-04-28 08:13 PaChongWeb\WebRoot\WEB-INF\lib
目录 0 2019-04-28 08:18 PaChongWeb\src\com
目录 0 2019-04-28 08:13 PaChongWeb\WebRoot\me
目录 0 2019-04-28 08:13 PaChongWeb\WebRoot\WEB-INF
目录 0 2019-04-28 08:13 PaChongWeb\.myeclipse
目录 0 2019-04-28 08:14 PaChongWeb\.settings
............此处省略6个文件信息
- 上一篇:基于Java实现的socket即时通信系统
- 下一篇:Java投票系统
相关资源
- 微博系统(Java源码,servlet+jsp),适
- 美食天下项目Android版源码和Web版源码
- 基于Java的酒店管理系统源码(毕业设
- u-blox_Android_GNSS_Driver_v3.10驱动源码+中
- 个人根据Android移动开发案例详解手写
- 基于JSP的学生宿舍管理系统(源码 数
- mysql jsp网站源码下载
- java access 仓库管理系统 源码
- java实现的svn统计修改代码行数完整源
- 即时通讯系统JAVA源码
- Java记事本【源代码 实验报告】
- java简单的购物车实例程序
- Java版航空订票系统源码
- java GUI版汉诺塔源码
- Android手机连连看游戏源码
- 搜索引擎的研究与实现Java附源码
- java 原创 坦克大战 源码 带有详细注释
- jsp与SQL Server数据库实现的客户注册登
- java实现POS系统源码
- java多人五子棋源码
- JAVA计算器实验报告与源码
- java做的人事档案管理系统
- 贪吃蛇(java 源码 eclipse项目)
- 自动出题系统(java 课程设计)
- java制作360度全景页面的源码和脚本
- jsp实用教程(源码)
- Android蓝牙和Cors网络开发源码
- USB串口通讯助手OTG转USB
- Java串口调试工具源码
- java web学生管理系统(源码+数据库+截
评论
共有 条评论