/**
* @author guoguo Email:tianjiaguo@tianjiaguo.com 2010-8-25上午09:15:32
*
*/
public class FileChange {
public static void main(String[] args) {
getListFiles("D:/java/com/tianjiaguo");
}
public static void getListFiles(String path) {
File file = new File(path);
FileChange.listFile(file);
}
public static void listFile(File f) {
if (f.isDirectory()) {
if (f.getName().startsWith(".")) {
return;
}
File[] t = f.listFiles();
for (int i = 0; i < t.length; i++) {
listFile(t[i]);
}
} else {
String path = f.getAbsolutePath();
if (path.endsWith(".... more
在线反编译工具: http://www.showmycode.com/
more
使用subclass配置hibernate的时候,使用父类的service操作数据库时会报如下的错误,其原因是缺少一个jar包,引入antlr-2.7.6rc1.jar就没有问题了。
java.lang.NoClassDefFoundError: antlr/ANTLRException
at org.hibernate.hql.ast. ASTQueryTranslatorFactory .createQueryTranslator( ASTQueryTranslatorFactory.java:35)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:72)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQuery... more
头都要大了,前几天更换博客主机,因为数据没有备份下来,为了不影响博客运行我就用之前备份的一个数据导入数据库中了。忽然想到这些数据太旧了,别叫google给索引了,错误的链接被索引了可不太好,于是我就修改了robots.txt文件,把网站设置为抓取工具无抓取权限。等数据整理好,我就把它改回了,今天登陆网站管理员工具才发现,天啊,google竟然有六天没有抓取我的网站数据了。
真怀具,今天申请了重新审核,希望能够恢复抓取吧。可算是长了记性了,宁可让抓取的东西是错误的,也不能设置为不抓取啊。
前几天重新更新了robots.txt,现在问题已经解决了,呵呵。这几天修改了不少地方的配置。
修改了blog的链接格式,以更利于seo,以前的数字... more
配置多个项目在同一个tomcat下的时候报如下错误
2010-5-26 16:54:42 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [web1/./] instead of [web2/./] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:132)
at org.springfr... more
需要的文件有:jquery,prettify
需要编写wordpress插件,其主要的代码如下:
function prettyCode($text){
// pretty codea
// 1 2 3 4 5
// (<(pre|code)[\W]?class="prettyprint(.*?)>)(.*?)(<\/(pre|code)>)
$pattern = '/(<(pre|code)[\W]?class="prettyprint(.*?)>)(.*?)(<\/(pre|code)>)/s';
if(preg_match_all($pattern,$text,$out,PREG_PATTERN_ORDER)){
for($i=0; $i<count($out[0]); $i++){
$match_old=$out[4][$i];
$match_content=str_replace("<","<",$match_old);
$text=str_replace($match_old, $match_content, $text);
}
$text.=' <... more
配置
修改deployerConfigContext.xml配置文件
<!-- <bean-->
<!-- class="org.jasig.cas.authentication. handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />-->
<bean class="com.guoguo.security.adapters. GuoCasAuthenticationHandler">
<property name="authenticationManager" ref="securityAuthenticationManager"></property>
</bean>
<bean id="securityAuthenticationManager" class="org.springframework.security. providers.ProviderManager">
<property name="providers">
<list>
<bean class="org.springframework.security.providers.d... more
如下代码在SyntaxHighlighter下有问题,会在代码后面增加一行“</grantedauthority></grantedauthority>”。还会改变代码内容,如下面的代码”</sec:authentication-manager>”
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
PATTERN_TYPE_APACHE_ANT
/admina/**=ROLE_SUPERVISOR,ROLE_ADMIN
/**
* guoguo-cas
* GuoUserDetailsService.java
* 2009-12-6 下午03:28:35
* @author guoguo, All right reserved.
*/
package com.guoguo.security.us... more