0

使用Jetty嵌入应用程序

Posted in Java at 九月 17th, 2012 / No Comments »

Jetty有个口号叫做:” Don’t deploy your application in Jetty, deploy Jetty in your application.”   本文演示如何使用嵌入式Jetty把HTTP Module嵌入应用程序。   Jetty不同的版本,包的结...

String path =CloudProperties.class.getClassLoader().getResource("db.properties").getPath(); try { path = java.net.URLDecoder.decode(path,"utf-8"); } catch (Unsupport...

0

openfire源码编译部署,运行

Posted in Java at 六月 8th, 2012 / No Comments »

环境: Windows, Linux, eclipse 3.7.2, OpenFire 3.7.1 在命令行下面编译: 1,安装JDK 2,安装ANT 3,配置环境变量: JAVA_HOME ANT_HOME 设置path环境变量,包含JAVA_HOME 目录下面的 bin 子目录,包含ANT_...

0

java过滤html标签函数

Posted in Java at 二月 16th, 2012 / No Comments »

public static String Html2Text(String inputString) { String htmlStr = inputString; //含html标签的字符串 String textStr =”"; java.util.regex.Pattern p_script; java.util.regex.Matcher m_script; java...

0

java php DES 加密解密

Posted in Java at 二月 11th, 2012 / No Comments »

Java代码 import java.io.IOException; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DE...

0

字符集编码

Posted in Java at 二月 7th, 2012 / No Comments »

1. 概述 本文主要包括以下几个方面:编码基本知识,java,系统软件,url,工具软件等。 在下面的描述中,将以”中文”两个字为例,经查表可以知道其GB2312编码是”d6d0 cec4″,Unicode编码 为”4e2d 6587&#...

用mysql实现数据库编程的时候不得不跟汉字打交道。下面有几个方案,可能能够帮助大家解决遇到的问题。 //这里要设置“useUnicode=true&characterEncoding=UTF8″ con=DriverManager.getConnection(“...

0

java类获取web应用的根目录

Posted in Java at 十二月 31st, 2011 / No Comments »

/** * * java类获取web应用的根目录 * */ public class PathUtil { /** * @param args */ public static void main(String[] args)throws Exception { PathUtil p = new PathUtil(); System.out.p...

原因是因为缺少 mysql数据库驱动包,mysql-connector-java-5.1.17-bin.jar这个包, 下载了之后放到工程下面,并右键-》属性》。。导入到eclipse里面,可是仍报这个错误。 上网搜了下原因,有的说 这个包在tomcat的...

Overview You can fairly easily today create an attractive web page using (X)HTML and CSS, but the moment you throw a Java applet into the mix you are asking for trouble. There is a jarring disconne...