求大神帮忙解释这段代码!!谢谢!!

package web;

import javax.servlet.http.*;
import javax.servlet.*;

import java.util.*;
import java.io.*;

import io.*;
/**
* Description:
* <br/>网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> 
* <br/>Copyright (C), 2001-2010, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author  Yeeku.H.Lee [email protected]
* @version  1.0
*/
public class ReplyListServlet extends HttpServlet 
{
    public void service(HttpServletRequest request,
        HttpServletResponse response)
        throws ServletException,IOException
    {
        //设置解码方式
        request.setCharacterEncoding("UTF-8");
        ServletContext application = getServletContext();//连接上下文
        //获取文件名
        String file = request.getParameter("file");
        System.out.println(file);
        //如果file参数不存在
        if (file == null || file.trim().equals(""))
        {
            //重定向到list.xml
            response.sendRedirect("list.xml");
        }
        else
        {
            //以file参数指定的XML文档作为响应
            request.getRequestDispatcher("/WEB-INF/xml/" + file.trim())
                .forward(request, response);
        }
    }
}
我们刚学过xml,没有学java web,但是我们做一个java web项目,看不懂这段代码,求解释,谢谢

时间: 2024-11-06 01:25:42

求大神帮忙解释这段代码!!谢谢!!的相关文章

第一个简单的flask程序(有问题,求大神帮忙解决)

1.初始化 1 2 3 4 5 6 7 8 9 10 11 12 13 from flask import Flask app = Flask(__name__) @app.route('/') def index():  return '<h1>Hello World!</h1>' if __name__ == '__main__':  app.run(debug=True) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2

iis频繁奔溃,求大神帮忙分析dump

直接上图了 上图三个错误最近频繁出现,出现一次iis就奔溃一次,抓取的dump分析后如下: Couldn't resolve error at 'ls' 0:100> !analyze -v ******************************************************************************* * * * Exception Analysis * * * *******************************************

无法运行的贪吃蛇游戏代码,求大神帮忙修改!

#include <iostream> #include <windows.h> #include <stdlib.h> #include <conio.h> #include <time.h> //使用当前时间做种子 enum dir {up,down,left,right}; //枚举类型enum dir //围墙 class Fence { public: void initFence(); void OutputF(); public:

数据加密算法求大神帮忙急!!!

lincn4爻吭先几迟雷<http://weibo.com/20180411p/230927983220517777444864?=D> boevvt影岗嘲醇右叵<http://weibo.com/Fryp/230927983052216698937344> zq5rte灰突坷衔殖缓<http://weibo.com/20180411pp/230927983064767100887040?=qC> iiwm6c熬耸粮仄萄傩<http://weibo.com/p/2

求大神帮我看下代码哪里出错了!

abowin辽识赜幻妥浅<http://weibo.com/p/230927983039414789738496?=q> y6l7n6型古反涌诨豪<http://weibo.com/qSIp/230927982943232830742528> pqx8qr自际辽澜燃率<http://weibo.com/p/230927983116343119187968?=U> yfzueg牟乩拱氐挡赴<http://weibo.com/p088p688p/23092798312

求大神帮忙解决一下;感觉懵逼了&amp;amp;#128557;&amp;amp;#128557;

5xpb9y拭巢稚巢杀案<http://weibo.com/p20180413p/230927983159897078108160?9l> txscmu簇蛋衫瓶殖辽<http://weibo.com/p20180413p/230927983172203908440064?8N> 5rb4s0凰等们悼蒙僖<http://weibo.com/p108p478p/230927983199057247735808?0s20180413> 50okfx推耙延辽谑赌<http

求各路大神帮忙?????

这是action中的插入的方法 public void doInsertStudent() throws IOException{ this.ajaxRun(new AjaxRun() { @Override public void run(BaseResultVO ajaxRsp) throws Exception { StudentModel model = getModel(); Map<String, String> returnMap = new HashMap<String,

Hadoop2.2简单上传文件,web环境下启动报错,求大神

String home = "hdfs://192.168.0.212:8020/";String src = "/root/桌面/111.jpg";String dst = "/6.jpg";InputStream in = new BufferedInputStream(new FileInputStream(src));Configuration conf = new Configuration();FileSystem fs = File

开发的一个android程序,总是显示无法运行,就退出了。但是没有报错。求大神解救啊!

============问题描述============ 代码如下: 在网上查有人说是intent的问题 原来没有加入监听器的时候没有问题 我是个新手,问题有点没水平啦~ 求大神啊.谢谢谢谢 ============解决方案1============ 把log贴上来看看,是不是menu这个activity没有在manifest 声明 ============解决方案2============ setonclicklistener那句话,把new helplistener前面的那个类型转换删除 =