资源简介
java web项目使用qrcode创建二维码方法示例,生成二维码图片目录在webroot目录下的qrcode文件夹下,生成前会自动判断目录是否存在并生成图片二维码。

代码片段和文件信息
package com.test;
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.test.unti.QrcodeHelper;
public class getQrcode extends HttpServlet
{
/**
* 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
{
QrcodeHelper.getQrcode(request);
request.getRequestDispatcher(“show.jsp“).forward(request response);
// response.setContentType(“text/html“);
// PrintWriter out = response.getWriter();
// out.println(““);
// out.println(““);
// out.println(“ tle>A Servlet tle>“);
// out.println(“ “);
// out.print(“ This is “);
// out.print(this.getClass());
// out.println(“ using the GET method“);
// out.println(“ “);
// out.println(““);
// out.flush();
// out.close();
}
/**
* 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
{
doGet(request response);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1083 2018-06-11 09:54 WebQrcode\.classpath
文件 1334 2018-06-11 10:17 WebQrcode\.project
文件 522 2018-06-11 09:54 WebQrcode\.settings\.jsdtscope
文件 364 2018-06-11 09:54 WebQrcode\.settings\org.eclipse.jdt.core.prefs
文件 478 2018-06-11 09:54 WebQrcode\.settings\org.eclipse.wst.common.component
文件 414 2018-06-11 09:54 WebQrcode\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2018-06-11 09:54 WebQrcode\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-06-11 09:54 WebQrcode\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1160 2018-06-11 10:53 WebQrcode\build\classes\com\test\getQrcode.class
文件 3063 2018-06-11 10:49 WebQrcode\build\classes\com\test\unti\QrcodeHelper.class
文件 2013 2018-06-11 10:53 WebQrcode\src\com\test\getQrcode.java
文件 2321 2018-06-11 10:49 WebQrcode\src\com\test\unti\QrcodeHelper.java
文件 922 2018-06-11 10:51 WebQrcode\WebRoot\index.jsp
文件 39 2018-06-11 09:54 WebQrcode\WebRoot\me
文件 448 2018-06-11 10:52 WebQrcode\WebRoot\show.jsp
文件 1038000 2018-06-11 09:55 WebQrcode\WebRoot\WEB-INF\lib\Qrcode-C.jar
文件 49836 2018-06-11 09:55 WebQrcode\WebRoot\WEB-INF\lib\qrcode-R.jar
文件 972 2018-06-11 09:56 WebQrcode\WebRoot\WEB-INF\web.xm
目录 0 2018-06-11 09:57 WebQrcode\build\classes\com\test\unti
目录 0 2018-06-11 09:56 WebQrcode\build\classes\com\test
目录 0 2018-06-11 09:57 WebQrcode\src\com\test\unti
目录 0 2018-06-11 09:56 WebQrcode\build\classes\com
目录 0 2018-06-11 09:56 WebQrcode\src\com\test
目录 0 2018-06-11 09:55 WebQrcode\WebRoot\WEB-INF\lib
目录 0 2018-06-11 09:56 WebQrcode\build\classes
目录 0 2018-06-11 09:56 WebQrcode\src\com
目录 0 2018-06-11 09:54 WebQrcode\WebRoot\me
目录 0 2018-06-11 09:54 WebQrcode\WebRoot\WEB-INF
目录 0 2018-06-11 09:54 WebQrcode\.settings
目录 0 2018-06-11 09:54 WebQrcode\build
............此处省略6个文件信息
相关资源
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- 美食天下项目Android版源码和Web版源码
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
评论
共有 条评论