javaweb——Response下载文件

2023-11-19

HttpServletResponse

web服务器接收到客户端的http请求,针对这个请求分别创建一个代表请求的HttpServletResponse对象,一个代表响应的HttpServletResponse对象;

  • 如果要获取客户端请求过来的参数:找HttpServletRequest
  • 如果要客户端响应一些信息:找HttpServletResponse

1、简单分类

  • 负责向浏览器发送数据的方法
public ServletOutputStream getOutputStream() throws IOException;

public PrintWriter getWriter() throws IOException;
  • 负责向浏览器**发送响应头(encoding…)**的方法
void setCharacterEncoding(String charset);
void setContentLength(int len);
void setContentLengthLong(long length);
void setContentType(String type);
void setDateHeader(String name, long date);
void addDateHeader(String name, long date);
void setHeader(String name, String value);
void addHeader(String name, String value);
void setIntHeader(String name, int value);
void addIntHeader(String name, int value);
  • 响应的状态码

    /**
     * Status code (100) indicating the client can continue.
     */
    public static final int SC_CONTINUE = 100;

    /**
     * Status code (101) indicating the server is switching protocols according
     * to Upgrade header.
     */
    public static final int SC_SWITCHING_PROTOCOLS = 101;

    /**
     * Status code (200) indicating the request succeeded normally.
     */
    public static final int SC_OK = 200;

    /**
     * Status code (201) indicating the request succeeded and created a new
     * resource on the server.
     */
    public static final int SC_CREATED = 201;

    /**
     * Status code (202) indicating that a request was accepted for processing,
     * but was not completed.
     */
    public static final int SC_ACCEPTED = 202;

    /**
     * Status code (203) indicating that the meta information presented by the
     * client did not originate from the server.
     */
    public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;

    /**
     * Status code (204) indicating that the request succeeded but that there
     * was no new information to return.
     */
    public static final int SC_NO_CONTENT = 204;

    /**
     * Status code (205) indicating that the agent <em>SHOULD</em> reset the
     * document view which caused the request to be sent.
     */
    public static final int SC_RESET_CONTENT = 205;

    /**
     * Status code (206) indicating that the server has fulfilled the partial
     * GET request for the resource.
     */
    public static final int SC_PARTIAL_CONTENT = 206;

    /**
     * Status code (300) indicating that the requested resource corresponds to
     * any one of a set of representations, each with its own specific location.
     */
    public static final int SC_MULTIPLE_CHOICES = 300;

    /**
     * Status code (301) indicating that the resource has permanently moved to a
     * new location, and that future references should use a new URI with their
     * requests.
     */
    public static final int SC_MOVED_PERMANENTLY = 301;

    /**
     * Status code (302) indicating that the resource has temporarily moved to
     * another location, but that future references should still use the
     * original URI to access the resource. This definition is being retained
     * for backwards compatibility. SC_FOUND is now the preferred definition.
     */
    public static final int SC_MOVED_TEMPORARILY = 302;

    /**
     * Status code (302) indicating that the resource reside temporarily under a
     * different URI. Since the redirection might be altered on occasion, the
     * client should continue to use the Request-URI for future
     * requests.(HTTP/1.1) To represent the status code (302), it is recommended
     * to use this variable.
     */
    public static final int SC_FOUND = 302;

    /**
     * Status code (303) indicating that the response to the request can be
     * found under a different URI.
     */
    public static final int SC_SEE_OTHER = 303;

    /**
     * Status code (304) indicating that a conditional GET operation found that
     * the resource was available and not modified.
     */
    public static final int SC_NOT_MODIFIED = 304;

    /**
     * Status code (305) indicating that the requested resource <em>MUST</em> be
     * accessed through the proxy given by the <code><em>Location</em></code>
     * field.
     */
    public static final int SC_USE_PROXY = 305;

    /**
     * Status code (307) indicating that the requested resource resides
     * temporarily under a different URI. The temporary URI <em>SHOULD</em> be
     * given by the <code><em>Location</em></code> field in the response.
     */
    public static final int SC_TEMPORARY_REDIRECT = 307;

    /**
     * Status code (400) indicating the request sent by the client was
     * syntactically incorrect.
     */
    public static final int SC_BAD_REQUEST = 400;

    /**
     * Status code (401) indicating that the request requires HTTP
     * authentication.
     */
    public static final int SC_UNAUTHORIZED = 401;

    /**
     * Status code (402) reserved for future use.
     */
    public static final int SC_PAYMENT_REQUIRED = 402;

    /**
     * Status code (403) indicating the server understood the request but
     * refused to fulfill it.
     */
    public static final int SC_FORBIDDEN = 403;

    /**
     * Status code (404) indicating that the requested resource is not
     * available.
     */
    public static final int SC_NOT_FOUND = 404;

    /**
     * Status code (405) indicating that the method specified in the
     * <code><em>Request-Line</em></code> is not allowed for the resource
     * identified by the <code><em>Request-URI</em></code>.
     */
    public static final int SC_METHOD_NOT_ALLOWED = 405;

    /**
     * Status code (406) indicating that the resource identified by the request
     * is only capable of generating response entities which have content
     * characteristics not acceptable according to the accept headers sent in
     * the request.
     */
    public static final int SC_NOT_ACCEPTABLE = 406;

    /**
     * Status code (407) indicating that the client <em>MUST</em> first
     * authenticate itself with the proxy.
     */
    public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;

    /**
     * Status code (408) indicating that the client did not produce a request
     * within the time that the server was prepared to wait.
     */
    public static final int SC_REQUEST_TIMEOUT = 408;

    /**
     * Status code (409) indicating that the request could not be completed due
     * to a conflict with the current state of the resource.
     */
    public static final int SC_CONFLICT = 409;

    /**
     * Status code (410) indicating that the resource is no longer available at
     * the server and no forwarding address is known. This condition
     * <em>SHOULD</em> be considered permanent.
     */
    public static final int SC_GONE = 410;

    /**
     * Status code (411) indicating that the request cannot be handled without a
     * defined <code><em>Content-Length</em></code>.
     */
    public static final int SC_LENGTH_REQUIRED = 411;

    /**
     * Status code (412) indicating that the precondition given in one or more
     * of the request-header fields evaluated to false when it was tested on the
     * server.
     */
    public static final int SC_PRECONDITION_FAILED = 412;

    /**
     * Status code (413) indicating that the server is refusing to process the
     * request because the request entity is larger than the server is willing
     * or able to process.
     */
    public static final int SC_REQUEST_ENTITY_TOO_LARGE = 413;

    /**
     * Status code (414) indicating that the server is refusing to service the
     * request because the <code><em>Request-URI</em></code> is longer than the
     * server is willing to interpret.
     */
    public static final int SC_REQUEST_URI_TOO_LONG = 414;

    /**
     * Status code (415) indicating that the server is refusing to service the
     * request because the entity of the request is in a format not supported by
     * the requested resource for the requested method.
     */
    public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;

    /**
     * Status code (416) indicating that the server cannot serve the requested
     * byte range.
     */
    public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;

    /**
     * Status code (417) indicating that the server could not meet the
     * expectation given in the Expect request header.
     */
    public static final int SC_EXPECTATION_FAILED = 417;

    /**
     * Status code (500) indicating an error inside the HTTP server which
     * prevented it from fulfilling the request.
     */
    public static final int SC_INTERNAL_SERVER_ERROR = 500;

    /**
     * Status code (501) indicating the HTTP server does not support the
     * functionality needed to fulfill the request.
     */
    public static final int SC_NOT_IMPLEMENTED = 501;

    /**
     * Status code (502) indicating that the HTTP server received an invalid
     * response from a server it consulted when acting as a proxy or gateway.
     */
    public static final int SC_BAD_GATEWAY = 502;

    /**
     * Status code (503) indicating that the HTTP server is temporarily
     * overloaded, and unable to handle the request.
     */
    public static final int SC_SERVICE_UNAVAILABLE = 503;

    /**
     * Status code (504) indicating that the server did not receive a timely
     * response from the upstream server while acting as a gateway or proxy.
     */
    public static final int SC_GATEWAY_TIMEOUT = 504;

    /**
     * Status code (505) indicating that the server does not support or refuses
     * to support the HTTP protocol version that was used in the request
     * message.
     */
    public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
200:请求响应成功
3xx:请求重定向
	重定向:你重新到我给你新位置去;
4xx:找不到资源   404
	资源不存在
5xx:服务器代码错误  500
	502: 网关错误
	

2、常见应用

1.向浏览器输出消息
2.下载文件——
(1)要获取下载文件的 路径
(2)下载的文件名是什么?
(3)设置想办法让浏览器能支持下载我们需要的东西
(4)获取下载文件的输入流
(5)创建缓冲区
(6)获取OutputStream对象
(7)将FileOutputStream流写入到buffer缓冲区
(8)将OutputStream将缓冲区中的数据输出到客户端

创建一个web项目

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

完善项目结构

在这里插入图片描述

  • web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0"
         metadata-complete="true">
</web-app>

在resources下添加一个图片1.png

在这里插入图片描述
在这里插入图片描述

在com.kuang.servlet包下创建FileServlet文件

package com.kuang.servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLEncoder;

public class FileServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//
        //  (1)要获取下载文件的 路径
//        String realPath = this.getServletContext().getRealPath("/1.png");

        String realPath = "D:\\学习笔记\\狂神说Java\\javaweb-02-servlet\\response\\target\\classes\\1.png";
        System.out.println("下载文件的路径:"+realPath);
        //	(2)下载的文件名是什么?
        String fileName = realPath.substring(realPath.lastIndexOf("\\")+1);
        //	(3)设置想办法让浏览器能支持(Content-Disposition)下载我们需要的东西.URLEncoder.encode(fileName,"UTF-8")):用来处理中文编码,否则可能会乱码
//        resp.setHeader("Content-Disposition","attachment;filename="+ fileName);
        resp.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName,"UTF-8"));
        //	(4)获取下载文件的输入流;FileInputStream将文件变成流
        FileInputStream in = new FileInputStream(realPath);
        //	(5)创建缓冲区
        int len = 0;
        byte[] buffer = new byte[1024];
        //	(6)获取OutputStream对象
        ServletOutputStream out = resp.getOutputStream();
        //	(7)将FileOutputStream流写入到buffer缓冲区,将OutputStream将缓冲区中的数据输出到客户端
        while((len=in.read(buffer))>0){
            out.write(buffer,0,len);
        }
        //(8)关闭流
        in.close();
        out.close();

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}

修改web.xml

 <servlet>
        <servlet-name>fileDown</servlet-name>
        <servlet-class>com.kuang.servlet.FileServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>fileDown</servlet-name>
        <url-pattern>/down</url-pattern>
    </servlet-mapping>

在这里插入图片描述

HttpServletRequest

参考页面

web文件下载头信息

错误

文件下载只显示页面,不提示文件下载
错误显示
在这里插入图片描述
原因:
在这里插入图片描述
正确显示:
在这里插入图片描述
正确代码:

package com.kuang.servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URLEncoder;

public class FileServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//
        //  (1)要获取下载文件的 路径
//        String realPath = this.getServletContext().getRealPath("/1.png");

        String realPath = "D:\\学习笔记\\狂神说Java\\javaweb-02-servlet\\response\\target\\classes\\1.png";
        System.out.println("下载文件的路径:"+realPath);
        //	(2)下载的文件名是什么?
        String fileName = realPath.substring(realPath.lastIndexOf("\\")+1);
        //	(3)设置想办法让浏览器能支持(Content-Disposition)下载我们需要的东西.URLEncoder.encode(fileName,"UTF-8")):用来处理中文编码
//        resp.setHeader("Content-Disposition","attachment;filename="+ fileName);
//        resp.setHeader("Content-Disposition","attachment:filename="+ URLEncoder.encode(fileName,"UTF-8"));

        resp.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName,"UTF-8"));
        //	(4)获取下载文件的输入流;FileInputStream将文件变成流
        FileInputStream in = new FileInputStream(realPath);
        //	(5)创建缓冲区
        int len = 0;
        byte[] buffer = new byte[1024];
        //	(6)获取OutputStream对象
        ServletOutputStream out = resp.getOutputStream();
        //	(7)将FileOutputStream流写入到buffer缓冲区,将OutputStream将缓冲区中的数据输出到客户端
        while((len=in.read(buffer))>0){
            out.write(buffer,0,len);
        }
        //(8)关闭流
        in.close();
        out.close();

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

javaweb——Response下载文件 的相关文章

  • Jackson JSON + Java 泛型

    我正在尝试将以下 JSON 反序列化 映射到List
  • 同一服务器上的许多应用程序具有相同的 JMX Mbean 类

    我有超过 5 个 Spring Web 应用程序 它们都在使用另一个通用库 这个公共库有它自己的 MBean 由于强制的唯一 objectName 约束 我的应用程序无法部署在同一服务器上 我使用 MBean 的方式是这样的 Managed
  • 非易失性领域的出版与阅读

    public class Factory private Singleton instance public Singleton getInstance Singleton res instance if res null synchron
  • 如何使用 Java 引用释放 Java Unsafe 内存?

    Java Unsafe 类允许您按如下方式为对象分配内存 但是使用此方法在完成后如何释放分配的内存 因为它不提供内存地址 Field f Unsafe class getDeclaredField theUnsafe Internal re
  • getCurrentSession 在网络中休眠

    我正在使用 hibernate 和 jsp servlet 编写一个基于 Web 的应用程序 我读过有关sessionFactory getCurrentSession and sessionFactory openSession方法 我知
  • 将类转换为 JSONObject

    我有好几堂这样的课 我想将类转换为 JSONObject 格式 import java io Serializable import com google gson annotations SerializedName public cla
  • 为什么 jar 执行的通配符在 docker CMD 中不起作用?

    我有一个Dockerfile与以下CMD启动我的 Spring Boot 应用程序 FROM java 8 jre CMD java jar app file jar 当我尝试从创建的图像启动容器时 我得到 Error Unable to
  • Java AES 256 加密

    我有下面的 java 代码来加密使用 64 个字符密钥的字符串 我的问题是这会是 AES 256 加密吗 String keyString C0BAE23DF8B51807B3E17D21925FADF273A70181E1D81B8EDE
  • JAXB - 忽略元素

    有什么方法可以忽略 Jaxb 解析中的元素吗 我有一个很大的 XML 文件 如果我可以忽略其中一个大而复杂的元素 那么它的解析速度可能会快很多 如果它根本无法验证元素内容并解析文档的其余部分 即使该元素不正确 那就更好了 例如 这应该只生成
  • 为什么在将 String 与 null 进行比较时会出现 NullPointerException?

    我的代码在以下行中出现空指针异常 if stringVariable equals null 在此语句之前 我声明了 stringVariable 并将其设置为数据库字段 在这个声明中 我试图检测该字段是否有null值 但不幸的是它坏了 有
  • 如何使用双重调度来分析图形基元的交集?

    我正在分析图形基元 矩形 直线 圆形等 的交互并计算重叠 相对方向 合并等 这被引用为双重调度的一个主要示例 例如维基百科 http en wikipedia org wiki Double dispatch 自适应碰撞算法通常要求 不同的
  • 使用 Proguard 通过 Dropbox.com 库混淆 Android 应用程序

    我刚刚创建了一个需要 Dropbox com API 库的 Android 应用程序 我现在尝试在 发布 模式下构建应用程序 并希望在代码上运行混淆器以对其进行混淆 但是 每当我尝试运行 Proguard 时 都会收到以下错误 Progua
  • 类更改(例如字段添加或删除)是否保持 Serialized 的向后兼容性?

    我有一个关于 Java 序列化的问题 在这种情况下 您可能需要修改可序列化类并保持向后兼容性 我有丰富的 C 经验 所以请允许我将 Java 与 NET 进行比较 在我的Java场景中 我需要使用Java的运行时序列化机制序列化一个对象 并
  • Lombok 不适用于 Eclipse Neon

    我下载了lombok jar lombok 1 16 14 jar 并将其放入我的下载中 然后我点击这个 jar 执行正确地识别了我的 MacOS 上的 Eclipse 实例 然后我选择了我想要的实例 Lombok也在pom xml中指定
  • 带 getClassLoader 和不带 getClassLoader 的 getResourceAsStream 有什么区别?

    我想知道以下两者之间的区别 MyClass class getClassLoader getResourceAsStream path to my properties and MyClass class getResourceAsStre
  • 什么是 Java2D 处理程序线程?

    我创建了一个使用 Hibernate 的示例 java 应用程序 当我进行线程转储时 我观察到一个名为 Java2D Disposer 的奇怪线程 有人能告诉我该线程的功能吗 AWT 系统中的某些实体需要最终确定以释放资源 最突出的例子是j
  • 使用 DBCP 配置 Tomcat

    在闲置一段时间 几个小时 后 我们收到了 CommunicationsException 来自 DBCP 错误消息 在异常中 位于这个问题的末尾 但我没有看到任何配置文件中定义的 wait timeout 我们应该看哪里 在 tomcat
  • 设置 TreeSet 的大小

    有没有办法像数组一样对 Java 集合中的 TreeSet 进行大小限制 例如我们在数组中 anArray new int 10 数组具有固定长度 在创建数组时必须指定该长度 A TreeSet当您向其中添加元素时会自动增长 您无法设置其大
  • 关闭扫描仪是否会影响性能

    我正在解决一个竞争问题 在问题中 我正在使用扫描仪获取用户输入 这是 2 个代码段 一个关闭扫描器 一个不关闭扫描器 关闭扫描仪 import java util Scanner public class JImSelection publ
  • GAE 无法部署到 App Engine

    我正在尝试从 Eclipse 发布 Web 应用程序 我在 GAE 上创建了四个项目 可以通过登录我的帐户并查看控制台来查看它们 我已经改变了appengine web xml到项目的应用程序 ID 如果我将其更改为 GAE 上第一个创建的

随机推荐

  • 2023年数学建模B组:利用AHP层次分析法解决实际问题(Matlab)

    目录 利用AHP层次分析法解决实际问题 Matlab实现 介绍 案例背景 步骤1 建立层次结构模型
  • Flutter酷炫的路由动画效果

    现在Flutter的路由效果已经非常不错了 能满足大部分App的需求 但是谁不希望自己的App更酷更炫那 下面介绍几个酷炫的路由动画 其实路由动画的原理很简单 就是重写并继承PageRouterBuilder这个类里的transitions
  • 详解JS前端异步文件加载篇之Async与Defer区别

    目录 同步 异步及推迟的概念 async和defer解决文件加载阻塞问题 在了解async和defer的区别之前 我们需要先了解同步 异步和推迟的概念 同步 异步及推迟的概念 假如现在有一条非常狭隘的胡同 里面有两个人挨着走 那么现在请问后
  • Java集合的两种遍历方式

    Java集合共有两种遍历方式 增强for循环 foreach 迭代器 Main方法 public static void main String args 创建集合 Collection collection new ArrayList 添
  • XXL-JOB分布式任务调度平台配置详解

    XXL JOB是一个分布式任务调度平台 其核心设计目标是开发迅速 学习简单 轻量级 易扩展 个人建议 对于需要定时调度任务开箱即用的小伙伴来说 完全可以学习参考下 本文主要介绍了Xxl Job分布式任务调度框架的配置信息详解 以及路由策略
  • git clone下新项目后运行报错‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。

    报错 vue cli service 不是内部或外部命令 也不是可运行的程序 或批处理文件 因为项目里还没有node modules这个包 需要运行npm install 运行后没有报错但是有个警告 npm WARN read shrink
  • MySQL导入导出数据mysqldump,mysql,select into file,load data

    研发人员往往需要从数据库中导出数据 或者将数据导入到数据库中 一些客户端工具提供了简单方便的功能 可以让他们不用使用命令进行操作 但是客户端工具可能会受到环境的限制而不能使用 所以 研发人员有必要掌握一些常用的命令来进行操作数据 MySQL
  • 残差神经网络的研究

    目录 一 ResNet残差神经网络 1 1 提出 1 2 作用 1 3 应用场景 1 4 残差单元的结构 1 4 1 残差网络得名的原因 1 4 2 残差网络可以有效缓解退化现象的原因 1 4 3 数学原理 二 附录 2 1 残差神经网络可
  • GD32F303调试小记(一)之USART(接收中断、接收空闲中断+DMA、发送DMA)

    前言 之前写了GD32F103调试小记 二 之USART 接收中断 接收空闲中断 DMA 发送DMA 一文 这次我们来看看GD32F303的USART是如何配置的 结合这两篇文章 相信大家GD32的USART配置流程会十分熟悉 DMA 能大
  • SpringBoot项目实战,附源码

    SpringBoot2 0笔记 一 SpringBoot基本操作 环境搭建及项目创建 有demo 二 SpringBoot基本操作 使用IDEA打war包发布及测试 三 SpringBoot基本操作 SpringBoot整合SpringDa
  • 逆向爬虫09 协程 & 异步编程(asyncio)

    逆向爬虫09 协程 异步编程 asyncio 1 什么是协程 What 协程 Coroutine 也可以被称为微线程 是一种用户态内的上下文切换技术 简而言之 其实就是通过一个线程实现代码块相互切换执行 def func1 print 1
  • Unity 拖尾(Trail Renderer)效果的实现

    1 新建场景 创建一个球 在球上添加组件Trail Renderer 2 在Trail Renderer组件设置Time为0 5 Materials材质 3 Width下点击右键 Add key 添加控制点 起始宽度为1 0 结束宽度为0
  • Nginx配置https网站

    1 什么是https https超文本传输安全协议是http ssl安全套接层和tls传输层安全的组合 用于提供加密通信和鉴定网络服务器的身份 网上的支付交易 个人隐私和企业中的敏感信息等越来越受到人们的关注和保护 因此https目前已经是
  • ICCV 2021: AdaAttN: Revisit Attention Mechanism in Arbitrary Neural Style Transfer 阅读笔记

    ICCV 2021 AdaAttN Revisit Attention Mechanism in Arbitrary Neural Style Transfer 论文 https arxiv org pdf 2108 03647 pdf 代
  • app上架流程的整理

    app的上架流程 一 准备工作 首先需要有开发者账号 企业级的账号是299 个人开发者账号是99 没有的话可以登录http developer apple com 自行申请 假如你已经有账号了 进入苹果官网点击Accout登录 二 申请证书
  • Android课设——理财小助手

    一 app介绍 理财小助手是一款利用Android studio软件实现的APP 可以录入每天的消费项目以及消费金额 同时也可以查找消费记录 统计消费总额 我用到的Android studio版本如下 二 模块设计 下面是我实现的一些模块
  • iOS Sqlite数据库增删改查基本操作

    Sqlite是ios上最常用的数据库之一 大家还是有必要了解一下的 实现效果如图 先来看看数据库方法类 将各个操作都封装在一个类里面 达到代码重用的目的 这是程序员都应该努力去实现的目标 这样在下一次用到同样的方法和类的时候 就可以直接使用
  • 推荐几款实用的Android Studio 插件

    http www jcodecraeer com a anzhuokaifa Android Studio 2015 1009 3557 html
  • 【Python小游戏】当当当当 万众瞩目得《滑雪大冒险》来啦~(附源码)

    前文 大家好 我是梨子同学 希望大家多多支持我 哈哈 为了感谢每一个关注我的小可爱 每篇文章的项目源码都是无偿分享滴 见文末 很多csdn的功能还在研究中 还有小编的文笔不好勿怪 会慢慢进步跟大家一起学习的 小编也一直在学习编程 如果代码小
  • javaweb——Response下载文件

    HttpServletResponse web服务器接收到客户端的http请求 针对这个请求分别创建一个代表请求的HttpServletResponse对象 一个代表响应的HttpServletResponse对象 如果要获取客户端请求过来