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下载文件 的相关文章

  • 无法访问类型的封闭实例。 [复制]

    这个问题在这里已经有答案了 整个代码是 public class ThreadLocalTest ThreadLocal
  • 静态方法的 Java 内存模型

    我来自操作系统和 C 语言背景 在代码编译时 世界很简单 需要处理和理解堆栈 堆文本部分等 当我开始学习 Java 时 我确实了解 JVM 和垃圾收集器 我对静态方法感到很有趣 根据我的理解 类的所有实例都会在堆中创建 然后被清理 但是 对
  • 无法实例化接收器 com.parse.GcmBroadcastReceiver

    我正在编写一个使用 GCM 通知和解析推送的离子应用程序 这个应用程序正在使用这些插件 com ionic keyboard 1 0 3 Keyboard com phonegap plugins PushPlugin 2 4 0 Push
  • @OneToMany 与 @JoinTable 错误

    我试图理解 OneToMany with JoinTable 对于这样的场景 我正在使用 JPA 2 1 Hibernate 5 0 4 和 Oracle 11 XE 当我打电话时userDao save user 下面的代码 我有 jav
  • 用 java 编写解释器时的 switch 或 if 语句

    当前的作业需要我编写一个程序 以一种非常微小且基本的编程语言 行为有点像 FORTRAN 来读取包含指令的文件并执行这些指令 基本上它是我猜的语言的简单解释器 它是完全线性的 所有语句都是按顺序定义的 并且只有字符串和整数变量 我需要查找和
  • 尝试在java中的Arraylist中查找对象的所有出现

    我有一个 Java ArrayList 我需要查找其中出现的所有特定对象 ArrayList indexOf Object 方法只找到一次出现 所以看来我还需要其他东西 我认为你不需要太花哨 以下应该可以正常工作 static
  • Java 唤醒休眠线程

    我阅读了其他帖子 但没有找到我正在寻找的确切答案 所以我希望有人能给出一些澄清 我有一个将运行一段时间的程序 我有一些在后台运行的线程来执行各种任务 为了简单起见 让我们考虑 3 个线程 ThreadA每 10 秒执行一次任务 其中Thre
  • Java 泛型:如何为泛型类型指定类类型?

    我有一个 POJO 指定为 MyClass u where U是泛型类型参数 我正在尝试编写一个接受类引用的实用方法Class u
  • Java元数据读写

    是否可以以通用方式 对于所有图像类型 在 Java 中读取和写入元数据 我找到了一些示例 但它们总是特定的 例如 JPEG 或 PNG 我需要一些足够通用的东西 而不是到处都有 if else 语句 我不想重写源代码 但这是一个很好的例子
  • SimpleDateFormat 将 lenient 设置为 false 时出现异常

    为什么这段代码会抛出无法解析日期的异常 SimpleDateFormat f new SimpleDateFormat yyyy MM dd T HH mm ss 000Z f setLenient false String dateStr
  • 不要模拟值对象:过于通用的规则,没有解释

    以下是 Mockito 单元测试框架的引用 不要模拟值对象 为什么有人会想要这样做呢 因为实例化对象太痛苦了 gt 无效 原因 如果创造新的装置太困难 那就是一个迹象 代码可能需要一些认真的重构 另一种方法是创建 价值对象的构建者 有一些工
  • Java ConcurrentModificationException [重复]

    这个问题在这里已经有答案了 当删除倒数第二个元素时 没有 ConcurrentModificationException List
  • 是否可以为 azure blob 存储中的给定目录生成具有写入权限的 SAS(共享访问签名)

    我们的 blob 存储帐户结构 容器名称 simple 在这个容器内我们有 blob aa one zip aa two zip bb ss zip bb dd zip 是否可以生成对aa 目录 有写权限 但对bb 目录 没有访问权限的SA
  • 如何使用云打印打印Android活动显示

    我正在尝试将 Google 云打印实现到应用程序中 遵循集成指南 https developers google com cloud print docs android 我试图通过打印 google com 来保持基本 单击我创建的打印按
  • 我们可以使用 for-each 循环来迭代 Iterator 类型的对象吗? [复制]

    这个问题在这里已经有答案了 如果我们执行以下操作 我们会收到错误 class FGH public static Iterator reverse List list Collections reverse list return list
  • 我们可以有虚假中断吗?

    我正在创建一个任务轮询器 每分钟都会查找任务 它看起来像这样 public class Poller private final ExecutorService e Executors newSingleThreadExecutor pub
  • 如何从spark中的hbase表中获取所有数据

    我在 hbase 中有一个大表 名称为 UserAction 它具有三个列族 歌曲 专辑 歌手 我需要从 歌曲 列族中获取所有数据作为 JavaRDD 对象 我尝试了这段代码 但效率不高 有更好的解决方案来做到这一点吗 static Spa
  • 编写自定义 Eclipse 调试器

    EDIT 一定有某种方法可以解决这个问题 而无需编写全新的调试器 我目前正在研究在现有 java 调试器之上构建的方法 如果有人对如何获取 Java 调试器已有的信息 有关堆栈帧 变量 原始数据等 有任何想法 那将非常有帮助 我想要做的是我
  • 使用 Runtime.getRuntime().exec() 进行重定向不起作用

    我需要从程序执行命令 命令行是可以的 我在终端试了一下 但是在程序中不行 我从我的代码中添加一个副本 File dir new File videos String children dir list if children null Ei
  • Integer.parseInt 引发的 NumberFormatException

    嘿 我在学校上编码课 但老师没有很好地解释 所以我们必须在网上查找我所做的信息 但我无法找到代码中的错误 你能帮我吗 char end s do System out println Tipo de boleto char boleto c

随机推荐

  • 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对象 如果要获取客户端请求过来