WebApplicationContext context = (WebApplicationContext) servletConfig .getServletContext() .getAttribute( WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); webrootDir = context.getResource("/").getFile().getAbsolutePath();     servlet中做法: getServle ...
  htmlunit相当于java的一个浏览器,可以分析页面,获得页面数据   import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebRequestSettings; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoy ...
1.准备环境:   下载felix, 运行felix.jar:org.apache.felix.main.Main函数 如何加入spring osgi -> start file:///home/jiangyy/workspace/spring-osgi-1.0.2/lib/slf4j-api-1.4.3.jar -> start file:///home/jiangyy/workspace/spring-osgi-1.0.2/lib/jcl104-over-slf4j-1.4.3.jar -> start file:///home/j ...
创建项目: svnadmin create /svn/projects/test Check out 版本: svn co http://ip/svn/test/ test svn co file:///svn/projects/test/ test import 文件: svn import -m "msg" . file:///svn/project/test/dir svn import -m "msg" . http://ip/svn/test/dir svn提供多个访问方式,通过http浏览: http://ip/svn/projectname file:///projectd ...
装confluence,使用mysql乱码,查出是mysql编码设置问题: 最终解决方案: mysql UTF8设置: vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock default-character-set=utf8 (数据库缺省以utf8存储) init_connect='SET NAMES utf8' (设定连接mysql数据库时使用utf8编码,以让mysql数据库为utf8运行) [client] default-character-set=utf8 ( ...
1.log4j 如下: <appender name="sf.easyajax.remote.IpFilter" class="org.jboss.logging.appender.RollingFileAppender"> <param name="File" value="/${jboss.server.home.dir}/log/IpFilter.log"/> <param name="Append" value="true"/> ...
<macrodef name="rsync"> <attribute name="local"/> <attribute name="remote"/> <sequential> <exec executable="rsync.exe"> <arg line="-rultvz @{local} @{remote}"/> </exec> </sequential> </macrodef> ...
excel表格导出,使用excel能读的xml格式,以下是丁的代码 /** * */ package util; import java.util.List; /** * @author crane.ding * */ public class ReportFormsFormat { public static String getFront() { String xls0 = "<?xml version='1.0'?>\n" + "<?mso-application ...
从以下代码中,我们了解到,getResource获得的,都是classes文件的相对路径。 new File()或use.dir则是项目路径或eclipse路径或tomcat/bin路径   /** * */ package servlet; import java.io.File; /** * 测试文件路径 * @author jiangyongyuan */ public class TestPath { public static void main(String []args){ printPath(); } ...
yongyuan.jiang
搜索本博客
最近加入圈子
存档
最新评论