ITeye博客

hiskyrisa的博客

hiskyrisa · 共 14 篇文章

基于Annotation和AOP实现Service缓存方案

简单的使用缓存的方法,就是在Service中嵌入调用缓存的代码。 1.先查询缓存, 2.若缓存命中,则返回 3.从数据库查询,并且往缓存中插入一份 这种做法导致许多许多重复代码,所以想到了用注解来调用缓存。并且在注解中设置key和expire 先定义注解 package com.cache; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation…

2018-06-12 16:31 · spring · aop · 评论(0)

Study:Jboss JMX调用引发的down机问题

Jboss服务器down机,从log上找不出任何问题,于是分析了一下dump文件。原来是cpu过高导致的。 top - 13:12:55 up 162 days, 3:05, 3 users, load average: 4.59, 5.35, 5.47 Tasks: 606 total, 5 running, 601 sleeping, 0 stopped, 0 zombie Cpu(s): 98.8%us, 0.7%sy, 0.0%ni, 0.2%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st Mem: 32959248k total, 26160344k used…

2014-12-16 15:01 · jboss · 评论(0)

Study:spring security简单例子

创建一个maven web项目,pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.hisky</groupId> <artifact…

2014-12-12 11:08 · spring · 评论(0)

Study:jboss jvm配置参数注释

//sth dev server jvm configuration 15:26:14,488 DEBUG [org.jboss.as.config] VM Arguments: -D[Standalone] -XX:+UseCompressedOops //请注意:这个参数默认在64bit的环境下默认启动,但是如果JVM的内存达到32G后,这个参数就会默认为不启动,因为32G内存后,压缩就没有多大必要了,要管理那么大的内存指针也需要很大的宽度了。 -XX:+TieredCompilation //默认是不打开的(可以用jinfo -flag或-XX:+PrintFlagsFinal来确认是…

2014-12-12 11:01 · java · 评论(0)

Study:基于Selenium进行Android客户端自动化测试的例子。

注意:此处省略ADB和Node.js的配置。 代码示例: package com.hisky.seleniumTest; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java…

2014-12-12 10:50 · selenium · 评论(1)

Study:基于Selenium进行firefox自动化测试的例子。

Maven配置: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.hisky</groupId> <artifactId>seleniumT…

2014-12-12 10:39 · selenium · 评论(0)

Exception:文件导入的异常

负责排查一个导入功能的bug,debug找到的信息如下: 页面点击导入后,将上传的文件提到到一个controller public ModelAndView importCSV( HttpServletRequest request, HttpServletResponse response ) throws Exception { s_logger.debug("importCSV: importing csv file "); long startTime = System.currentTimeMillis(); String responseText = ImportContacts…

2013-07-02 11:49 · spring · jsp · 评论(0)

Study:Spring的单例是否只意味着能创建一个实例

<?xml version="1.0" encoding="UTF-8"?> <!-- Bean头部 --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocat…

2013-06-13 19:02 · spring · 评论(0)

Study:SpringMVC整合Mybatis的完整例子

没时间贴代码了,直接上穿附件。

2013-03-27 19:16 · spring · 评论(0)

Study:SpringMVC3.2处理ajax请求

jsp页面如下: <form id="myForm" method="post" action="/mvc/student/add"> <table> <tr> <td>姓名</td> <td><input id="name" name="name" value="${name}" /></td> </tr> <tr> <td>性別</td> <td>男<input type="radio" name="sex" value="1" />女<input type="radio" name="sex" value="0" /> </td> </tr> <tr> <td>祖籍</td> <td>…

2013-03-25 22:30 · spring · 评论(0)

Study:mybatis的log打印SQL的问题

web.xml的配置也正确,log4j.properties配置也添加了。 # # Log4J Settings for log4j 1.2.x (via jakarta-commons-logging) # # The five logging levels used by Log are (in order): # # 1. DEBUG (the least serious) # 2. INFO # 3. WARN # 4. ERROR # 5. FATAL (the most serious) # Set root logger level to INFO and append to …

2013-03-23 22:14 · mybatis · 评论(0)

Exception:jsp提交form时input不填任何值,出现400错误

jsp页面如下: <form id="myForm" method="get" action="/mvc/student/getList"> <tr> <td>学号:</td> <td><input id="studentId" name="studentId" value="${student.studentId}" /></td> <td>姓名:</td> <td><input id="name" name="name" value="${student.name}" /></td> <td>性别:</td> <td>男<input type="radio" name="sex" val…

2013-03-23 16:45 · jsp · 评论(0)

Exception:JSP用foreach迭代list时出错,页面解析出错

HTTP ERROR 500 Problem accessing /mvc/student/getList. Reason: The class 'java.lang.String' does not have the property 'studentId'. Caused by: javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'studentId'. at javax.el.BeanELResolver.getBeanProperty(BeanELRe…

2013-03-23 16:15 · spring · 评论(0)

Exception:Spring3.2 AOP 事务管理

Spring的配置文件中,事务配置如下: <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="get*" read-only="true" /> <tx:method name="add*" propagation="REQUIRED"/> <tx:method name="delete*" propagation="REQUIRED"/> <tx:method name="update*" propagation="REQUIRED"/> <!…

2013-03-22 19:33 · spring · 评论(0)