共 34 篇文章 |
|
阅583 转2 评0 公众公开 07-04-13 09:04 |
按照AOP的思想,我们应该把日志记录代码分离出来。客户端调用商业方法的代码如下,BusinessInterface businessImp = new BusinessObject(); InvocationHandler handler = new LogHandler(businessImp); BusinessInterface proxy = (BusinessInterface) Proxy.newProxyInstance( businessImp.getClass().getClassLoade... 阅1531 转12 评0 公众公开 07-04-13 09:02 |
Timer#scheduleAtFixedRate(TimerTask, long, long) */ public class ScheduledTimerTask { private TimerTask timerTask;* @param timerTask the TimerTask to schedule * @param delay the delay before starting the task for the first time (ms) */ public ScheduledTimerTask(TimerTask t... 阅2232 转10 评0 公众公开 07-04-02 09:06 |
-- 声明一个事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource"/> </bean>--这一个Bean的配置与之前完全一样,没有变化----> <bean id="tran... 阅386 转1 评0 公众公开 07-03-30 09:49 |
阅2593 转8 评0 公众公开 07-03-23 10:13 |
对权限系统设计的再思考 什么是权限系统,权限系统究竟在整个系统中起到什么作用,或者说权限系统必须提供哪些功能?谈谈个人的看法,我认为授权和验证是一个权限系统最基本的功能,而一个更完善的权限系统会增加上如何验证和验证后如何处理这两种功能。对于一个权限系统的基本元素,我觉得只有两个:Principal(权限主体),权限。比如说A只能对... 阅2161 转7 评0 公众公开 07-03-23 09:39 |
2. 在web应用中为Spring配置log4jSpring的做法是使用一个Servlet Listener,在Web Container启动时把ROOT的绝对路径写到系统变量里,这样log4j的配置文件里就可以用${myAppfuse.root}来表示刚刚设进去的系统变量:log4j.appender.logfile.File=${myAppfuse.root}/logs/mylog.log在Web.xml中配置语句如下: 阅2154 转3 评0 公众公开 07-03-23 09:24 |
事实上,我只使用了Prototype的一个函数,它就是Ajax.Request(),它简化了我们繁琐的实例化XHR、监控请求状态的过程,语法如下: var ajax = new Ajax.Request(url, {method: " get " , onComplete:onResponse} ); 阅899 转7 评0 公众公开 07-03-02 11:08 |
6.在WebRoot下创建acegilogin.jsp<% @ page language = " java " pageEncoding = " UTF-8 " %> <% @ page import = " org.acegisecurity.ui.AbstractProcessingFilter " %> <% @ page import = " org.acegisecurity.ui.webapp.AuthenticationProcessingFilter " %> <% @ ... 阅2650 转18 评1 公众公开 07-02-07 14:59 |
-- Bean configuration --><bean id="businesslogicbean"class="org.springframework.aop.framework.ProxyFactoryBean"><property name="proxyInterfaces"><value>IBusinessLogic</value></property><property name="target"><ref local="beanTarget&... 阅233 转1 评0 公众公开 07-02-07 12:45 |