后端杂烩
文章平均质量分 74
budapest
原居合肥现在上海
展开
-
Tomcat中Connector常用配置及问题解决
Tomcat中Connector常用配置及问题解决转载 2022-09-06 10:36:42 · 4280 阅读 · 0 评论 -
【数据库负载过高问题】字段类型转换导致查询不能使用索引
1.原SQL语句SELECT TITLE, CODE, TYPE, YEAR, SS_DATE,URL FROM (SELECT TITLE, CODE, TYPE,TO_CHAR(SS_DATE,'yyyy-mm-dd') SSEDATE,URL FROM TABLE_A WHERE 1=1 AND ISVALIDATE='1' ...原创 2021-06-20 09:56:25 · 147 阅读 · 1 评论 -
在java中模拟XMLHttpRequest
这里所说的"模拟" 是指 : 在java中,使用类似 XMLHttpRequest 的方式来实现"同步/异步的HttpRequest"功能. 用 java 实现一个HTTPRequest 并不难. 通过 java.net 包内提供的东东 可以很容易的实现. 而且我们还有 apache 的 HttpClient 一类的组件可供我们使用 . 实现 异步的HTTPRequest转载 2013-07-27 15:43:10 · 8380 阅读 · 3 评论 -
hibernet实体类返回的list,是否需要判空?
DAOProduct 商品那边 @OneToMany(mappedBy = "product") @OrderBy("createTime") @Where(clause = "is_deleted=0") public List getMaterialGroup() { return materialGroup; }Mater原创 2012-02-16 17:13:37 · 941 阅读 · 0 评论 -
rmi 缺省端口1099的秘密
N/A原创 2012-01-22 22:39:16 · 1524 阅读 · 0 评论 -
Spring的配置文件,可以用applicationContext.xml+applicationContext.properties
以前只用过applicationContext.xml没有用过applicationContext.properties昨天在跟一个问题时,总是报applicationContext.xml, 以为这里有问题。后来发现是applicationContext.properties。 没有相关知识点,跟踪问题也很麻烦啊。原创 2012-02-15 14:24:05 · 2062 阅读 · 0 评论 -
URLConnection setCache(false)的真正作用?
N//A原创 2012-01-22 22:40:06 · 1561 阅读 · 1 评论 -
看主线程如何等待子线程处理完毕
问题描述:一个文件中有好几万条数据(暂不考虑大文件的读)原来程序采取主线程,经常会运行超时。现需优化,改为用多线程来处理。注意事项:当主线程在调用多个线程处理时,需分配好数据条目给每个线程,主线程必须等待每个子线程处理完毕,才能执行下面的命令。方法:运用CountDownLatch 类 public class FileItemsImport{@Override pub原创 2013-03-08 19:01:21 · 1764 阅读 · 1 评论 -
Java并行编程–从并行任务集获取反馈
在并行任务启动后,强制性地从并行任务得到反馈。假想有一个程序,可以发送批邮件,还使用了多线程机制。你想知道有多少邮件成功发送吗?你想知道在实际发送过程期间,这个批处理工作的实时进展吗?要实现多线程的这种反馈,我们可以使用Callable接口。此接口的工作方式基本上与Runnable相同,但是执行方法(call())会返回一个值,该值反映了执行计算的结果。[java] vie转载 2012-04-05 23:13:35 · 851 阅读 · 0 评论 -
HTTP 代理如何正确处理 Cookie
转自 http://www.ibm.com/developerworks/cn/java/j-cookie/这篇文章总结的真是太好了,正好对正在做的一个项目有指导作用,特转载一下,再次感谢作者黄 湘平 (xphuang@cn.ibm.com),简介: 大多数的 Web 应用程序都要求维护某种会话状态,如用户购物车的内容。这种会话状态的保持很多情况下需要借助于 Cookie 或者 Ses转载 2011-12-12 00:10:08 · 954 阅读 · 0 评论 -
高性能的通讯程序,服务器端的代码大致如下:
现在考虑这样一个情景。你要做一个高性能的通讯程序,现在按照传统方式开始做。客户端就不写了。服务器端的代码大致如下://建立一个服务器端socket ServerSocket socket = new ServerSocket(port,backlog); //开始监听 while((Socket socket = socket.accept())!=null) { //开一原创 2011-12-08 23:42:13 · 2136 阅读 · 0 评论 -
httpclient4的封装
HttpClient 4.0 GET POST 封装 package org.lujian.webqq.utils;import java.io.*;import java.util.*;import java.util.concurrent.TimeUnit;import org.apache.http.*;import org.apache.http转载 2011-12-08 23:15:43 · 5985 阅读 · 1 评论 -
Servlet中listener和filter的总结
转自:http://ruowu.javaeye.com/blog/661922Listener我是这样理解他的,他是一种观察者模式的实现:我们在web.xml中配置listener的时候就是把一个被观察者放入的观察者的观察对象队列中,当被观察者触发了注册事件时观察者作出相应的反应。在jsp/servlet中具体的实现是在web.xml中注册Listener,由Container转载 2011-11-30 12:44:48 · 2642 阅读 · 0 评论 -
Tomcat及MySQL中文乱码问题解决方案总览
Tomcat和MySQL组合作为Web开发的基础,已经很流行了,但其中的乱码问题让人烦心,经过一段时间的学习和实践,现在有了一些方法消除乱码。我用的平台是Tomcat 5.5.12+MySQL 4.1.14 操作系统为WinXP sp2 和 Redhat 7.2一、Tomcat配置的地方,主要针对5.5.X版本,其他低版本可能无效Tomcat安装到系统时,如果系统的内码为GBK,则能少原创 2013-10-20 20:17:01 · 1470 阅读 · 0 评论 -
在程序中用new ClassPathXmlApplicationContext()的注意事项
ApplicationContext appContext = // new ClassPathXmlApplicationContext原创 2014-08-11 15:43:03 · 60009 阅读 · 5 评论 -
501 Command "HELO" requires an argument问题排查记录
来源:http://blog.csdn.net/hbcui1984/article/details/5655657?reload转载 2014-10-21 08:42:28 · 1100 阅读 · 0 评论 -
一个java.lang.NoSuchMethodError问题的解决
据说:当看到异常信息里有NoSuchMethodError时,你应该很高兴,因为这种错误一般是因为jar包冲突引起的。如下面的异常信息。root causejava.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.getTokenTypeToASTClassMap()Ljava/util/Hashtable; org.h...原创 2018-06-20 20:09:44 · 70600 阅读 · 0 评论 -
Spring(1)-Spring loosely coupled example
The object-oriented is a good design to break your system into a group of reusable objects. However, when system grows large, especially in Java project, the huge objects dependencies will always tigh转载 2012-10-04 10:22:06 · 775 阅读 · 0 评论 -
Spring(2)-Spring Dependency Injection (DI)
package com.mkyong.output; import com.mkyong.output.IOutputGenerator; public class OutputHelper{ IOutputGenerator outputGenerator; public void setOutputGenerator(IOutputGenerator outp转载 2012-10-04 10:27:33 · 629 阅读 · 0 评论 -
Spring(4)-How to load multiple Spring bean configuration file
ProblemIn a large project structure, the Spring’s bean configuration files are located at different folders for easy maintainability and modular. For example,Spring-Common.xml in common folder,Spr转载 2012-10-04 11:26:37 · 1509 阅读 · 0 评论 -
Spring(5)-Spring bean scopes example
In Spring, bean scope is used to decide which type of bean instance should be return from Spring container back to the caller.5 types of bean scopes supported :singleton – Return a single bean i转载 2012-10-04 12:08:05 · 840 阅读 · 0 评论 -
Spring(6)-Spring Collections (List, Set, Map, and Properties) example
Spring Collections (List, Set, Map, and Properties) exampleBy mkyong - March 14, 2010 springSpring examples to show you how to inject values into collections type (List, Set, Map, and Proper转载 2012-10-04 15:16:19 · 2660 阅读 · 0 评论 -
Spring(7)-Spring init-method and destroy-method example
In Spring, you can use init-method and destroy-method as attribute in bean configuration file for bean to perform certain actions upon initialization and destruction. Alternative toInitializingBean转载 2012-10-04 15:28:27 · 1257 阅读 · 0 评论 -
Spring(8)-Spring Auto scanning components
Normally you declare all the beans or components in XML bean configuration file, so that Spring container can detect and register your beans or components. Actually, Spring is able to auto scan, detec转载 2012-10-04 21:56:52 · 915 阅读 · 0 评论 -
Spring(9)-Spring Auto-Wiring Beans with @Autowired annotation
In Spring, you can use @Autowired annotation to auto wire bean on the setter method, constructor or a field. Moreover, it can autowired property in a particular bean.NoteThe @Autowired annotation转载 2012-10-04 22:36:56 · 1042 阅读 · 0 评论 -
PV与并发之间换算的算法换算公式
PV与并发之间换算的算法换算公式并发连接数 = PV / 统计时间 * 页面衍生连接次数 * http响应时间 * 因数 / web服务器数量PV = 并发连接数 * 统计时间 * web服务器数量/ 页面衍生连接次数 / http响应时间 / 因数解释: 统计时间 : pv统计的总时间,单位秒,要计算一天的pv就是86400秒 页面衍生连接次数: 一个HT原创 2016-09-28 09:03:38 · 7978 阅读 · 0 评论 -
java连接SSH服务器并执行shell命令
package com.flyingzl.ssh;import java.util.ArrayListimport java.util.Hashtableimport java.util.Listimport org.apache.log4j.Loggerimport org.apache.oro.text.regex.MalformedPatternExceptionimpo转载 2011-11-27 20:44:12 · 10083 阅读 · 3 评论 -
Java 调用 Shell 命令
近日项目中有这样一个需求:系统中的外币资金调度完成以后,要将调度信息生成一个Txt文件,然后将这个Txt文件发送到另外一个系统(Kondor)中。生成文件自然使用OutputStreamWirter了,发送文件有两种方式,一种是用写个一个类似于FTP功能的程序,另外一种就是使用Java来调用Shell,在Shell中完成文件的发送操作。我们选择后一种,即当完成外币资金的调度工作后,用Java的Ou转载 2011-11-27 20:31:23 · 2887 阅读 · 0 评论 -
Java线程的传说(3)——如何关闭一个正在accept的ServerSocket?
加入一个ServerSocket正在另一个线程堵塞accept,那如何停止accept或者关闭Socket?Server socket 设置下超时 setSoTimeout 然后在Listen线程中用interrupt其实直接close socket也可以,不过会抛出异常,我的意思是有什么比较安全而又简单的办法?难道要加一个标志,然后要关闭的时候把标志设为stop,然后连接listernSocke翻译 2011-11-06 23:47:58 · 8568 阅读 · 0 评论 -
Java5.0之Annotation
Subject:[Java Annotation]Description:1.定义自己的注释类型定义新的注释类型与创建接口有很多类似之处,只不过 interface 关键字之前要有一个 @ 符号。package com.oreilly.tiger.ch06;/** * Marker annotation to indica原创 2010-04-08 22:34:00 · 898 阅读 · 0 评论 -
Java学习之路
jave怎么学习最快2008-11-08 06:57欲速则不达,学习JAVA没有“可以拉”这种程度。丰富多彩,学习一年的时间也不一定能学完基础,我曾经也想过这个问题,但后来看了一篇文章,便彻然醒悟。下面这篇文章(不要嫌长,看完就有收益,还有此问题不要关闭或是投票,回答都是辛苦地,不要打积极性,不够好也将就些吧): 江苏无锡 缪小东 1. Java语言基础 谈到Java语转载 2009-09-27 22:10:00 · 843 阅读 · 0 评论 -
编程修养
编程修养文章出处:http://www.diybl.com/course/3_program/gcs/20071010/77355.html编程修养———— 什么是好的程序员?是不是懂得很多技术细节?还是懂底层编程?还是编程速度比较快?我觉得都不是。对于一些技术细节来说和底层的技术,只要看帮助,查资料就能找到,对于速度快,只要编得多也就熟能生巧了。 我认为好的程序员转载 2009-02-03 16:06:00 · 765 阅读 · 0 评论 -
JavaWeb技术学习笔记(2)-关于tomcat的几个问题
目录:一: 关于Tomcat主要目录结构:二: 修改Tomcat端口号:三: 配置虚拟目录:四:关于Jsp 在服务器上的运行五: 介绍一下在Tomcat中server.xml里的几个主要元素. 一: 关于Tomcat主要目录结构: bin 存放启动和关闭Tomcat脚本 conf 包含不同的配置文件 work 存放jsp编译后产生的class文件 webapp原创 2008-04-30 17:21:00 · 669 阅读 · 0 评论 -
Java学习(3)-Java.Util包之其它类
本篇文章主要讨论不属于类集的而在java.util包中的一些常用的类.1. StringTokenizer主要用来对指定的串用指定的分隔符来分割返回。如果不指定分隔符,那么默认地分隔符可以是空格、tab键,回车以及换行。1.1) StringTokenizer的contstuctor 函数:StringTokenizer(String str)StringT原创 2007-07-04 09:55:00 · 1049 阅读 · 0 评论 -
Java学习(2)-Java.Util包之类集
Java.util包的 第1部分:类集框架(Java2中引入) Date: 2007-6-20目录1. 类集概述一个collection---有时也被称作容器---是一种能够把多个元素组织在同一个单元的简单对象。Collections常用来存储,获得,原创 2007-07-04 09:50:00 · 1222 阅读 · 0 评论 -
Java学习(1)-Java.Generics
Generics1) Introduction引言 1.1)为什么需要泛型?Generics add stability to your code by making more of your bugs detectable at compile time. (泛型让你的bugs在编译期间就能被更多地发现。)Compile-time bugs, for example, t原创 2007-07-04 09:43:00 · 4166 阅读 · 0 评论 -
Java学习(4)-Java.Lang包
Introduction: This article describes Java.lang and some important classes which be included.1.简单类型包装器1.1)为什么要简单类型包装器(wrapper)如Number, Byte, Double, Long?答:因为简单类型int, char不是对象层次上封装,简单类型只能处理传值原创 2007-07-04 09:58:00 · 1090 阅读 · 0 评论 -
JavascriptReference(4)- RegExp Objects
Brief:Regular expressions are a powerful tool for performing pattern matches in Strings in JavaScript. You can perform complex tasks that once required lengthy procedures with just a few lines of原创 2007-03-27 20:45:00 · 929 阅读 · 0 评论 -
JavascriptReference(3)-Event Handle
Firstly and most important thing, log my favorite reference as following:JavaScript fundamental http://www.javascriptkit.com/jsref/document.shtmlOf course, the story doesnt just end there. Lik原创 2007-03-27 19:52:00 · 1144 阅读 · 0 评论 -
JavascriptReference(2)-DOM
Brief: This article explains/lists DOM properties and methods. That is true you can refer most of them in your JavaScript.DOM (Document Object Model) ReferenceThe DOM (Document Object Model) gi原创 2007-03-27 19:44:00 · 1214 阅读 · 0 评论