• 大小: 131KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-05-21
  • 语言: Java
  • 标签: 源码  

资源简介

架构探险,从零开始写javaweb框架-源码..真正的全部源码

资源截图

代码片段和文件信息

package org.smart4j.chapter1;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by miraclewong on 16/5/8.
 */

@WebServlet(“/hello“)
public class HelloServlet extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req HttpServletResponse resp)
            throws ServletException IOException {
        DateFormat dateFormat = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss“);
        String currentTime = dateFormat.format(new Date());
        req.setAttribute(“currentTime“ currentTime);

        req.getRequestDispatcher(“/WEB-INF/jsp/hello.jsp“).forward(reqresp);
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\
     文件         189  2016-07-02 03:08  Smart-Book-Code-master\.gitignore
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\.idea\
     文件         686  2016-07-02 03:08  Smart-Book-Code-master\.idea\compiler.xml
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\.idea\copyright\
     文件          74  2016-07-02 03:08  Smart-Book-Code-master\.idea\copyright\profiles_settings.xml
     文件        3296  2016-07-02 03:08  Smart-Book-Code-master\.idea\misc.xml
     文件         731  2016-07-02 03:08  Smart-Book-Code-master\.idea\modules.xml
     文件       13863  2016-07-02 03:08  Smart-Book-Code-master\.idea\workspace.xml
     文件        1078  2016-07-02 03:08  Smart-Book-Code-master\LICENSE
     文件          87  2016-07-02 03:08  Smart-Book-Code-master\README.md
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\artifacts\
     文件         289  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\artifacts\chapter1_war.xml
     文件         795  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\artifacts\chapter1_war_exploded.xml
     文件        1192  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\compiler.xml
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\copyright\
     文件          74  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\copyright\profiles_settings.xml
     文件         172  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\encodings.xml
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\libraries\
     文件         566  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_1_0.xml
     文件         498  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\libraries\Maven__javax_servlet_jsp_jsp_api_2_2.xml
     文件         461  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\libraries\Maven__javax_servlet_jstl_1_2.xml
     文件        3464  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\misc.xml
     文件         256  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\modules.xml
     文件       48824  2016-07-02 03:08  Smart-Book-Code-master\chapter1\.idea\workspace.xml
     文件        1430  2016-07-02 03:08  Smart-Book-Code-master\chapter1\chapter1.iml
     文件        2508  2016-07-02 03:08  Smart-Book-Code-master\chapter1\pom.xml
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\src\
     目录           0  2016-07-02 03:08  Smart-Book-Code-master\chapter1\src\main\
............此处省略165个文件信息

评论

共有 条评论