Java-Web
CodingBugs
Nothing is impossible.
展开
-
通过Servlet读pdf文件
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/pdf"); InputStream in = this.g原创 2017-11-22 19:56:10 · 355 阅读 · 0 评论 -
通过Servlet读pdf文件
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/pdf"); InputStream in = this.g原创 2017-11-22 19:56:29 · 785 阅读 · 0 评论 -
Servlet和Ajax传递JSON
//getNationList.javaprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json; charset=utf原创 2017-11-25 16:30:48 · 299 阅读 · 0 评论 -
Connection的close和null的问题
BaseDao中获取Connection的方法public Connection getConn() { try { if(null == conn) { conn = db.getConnection(); } } catch (SQLException e) {原创 2018-01-18 10:50:36 · 3186 阅读 · 2 评论 -
MyEclipse断点无效
在排除断点条件,代码逻辑的问题 查看Tomcat服务器状态 debug状态 运行状态,断点无效 菜单栏启动默认为debug状态 之前一直使用菜单栏的按钮启动,后来在Console窗口旁边加了Servers窗口感觉启动很方便,没注意Mode这个属性,直接Run Service,应该选择Debug Service...原创 2018-01-18 11:09:16 · 1950 阅读 · 0 评论 -
Spring初始化Bean的顺序
构造函数->PostConstruct->InitializingBean的afterPropertiesSet方法->XML中bean的init-method指定初始化方法在使用PostConstruct是忽略了Spring对Bean的注入是通过扫描包中类的注解实现的,没有在XML中配置相关信息 (<context:component-scan base-packa...原创 2018-02-14 20:04:16 · 581 阅读 · 0 评论 -
Windows下部署多个免安装的Tomcat
公司一个项目需要部署2个war包A和B, B工程依赖于A工程,之前是将两个工程打包后直接丢到tomcat中测试,然后等待启动成功,但是由于A工程比较稳定,改动基本都是B工程中,但是tomcat每次启动都要部署一遍A工程,部署A工程的时间大约是2分钟左右,任务多的时候一天测试基本会部署十几次,按照原先的做法一天会浪费很多时间在重复部署A工程上,所以需要将A工程和B工程独立部署。 本机环境使用的是...原创 2019-03-02 18:54:35 · 387 阅读 · 0 评论 -
Log4j.xml配置
属性配置<properties> <!--${sys:LOG_HOME} jvm属性--> <property name="LOG_HOME">${sys:LOG_HOME}/app/logs</property></properties>Appenders配置name: Appenders名,后续通过name...原创 2019-03-11 20:04:00 · 649 阅读 · 0 评论