??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩国产网站,女人天堂在线,三级资源在线http://www.aygfsteel.com/scorpio_leon/archive/2006/06/10/51877.html李李李李Sat, 10 Jun 2006 11:16:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2006/06/10/51877.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/51877.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2006/06/10/51877.html#Feedback2http://www.aygfsteel.com/scorpio_leon/comments/commentRss/51877.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/51877.htmlZ(jin)降低侵入性,更好的被引用Q对bba96核心(j)部分q行?jin)大量重构,去除了(jin)冗赘的层次与不必要的接口,q借助jdk5.0范型q行?jin)代码精。发布了(jin)bba96 tiger beta2Q这个版本已l是比较E_的版本,具体的改动如?br />

  • 去除所有的接口依赖Q可直接在Q何项目中直接调用
  • service的两层合qؓ(f)一层且去除service层的接口Q但DAO曾仍保留接口以备扩展更多的orm实现
  • 增加sql execute的方?
  • 增强源自view的直接查询能?
  • 参数名由原来隄的oriNames, oriOperators, oriStringValues改ؓ(f)直观的searchName, searchOperator, searchValue
  • 增加?jin)对QueryParam的toString功能Q可打出对应的sqlQ便于调试,参见com.bba96.tiger.util.QueryWebUtils的main函数

下蝲面地址Q?a >https://bba96.dev.java.net/servlets/ProjectDocumentList?folderID=4149&expandFolder=4149&folderID=0

如果你用spring+hibernateQ而又不喜Ƣhibernate criteria的麻?ch),不妨试一下bba96Q你可以把主要精力放C务方面。DefaultEntityManager提供?jin)很多单层逻辑的便利方法给你用,其中也包括执行hsql或者sql查询/更新的方法,如果你要多层ơ逻辑的条件查询可以自q装QueryObjectQ参见com.bba96.tiger.util.QueryWebUtils的main函数。bba96q提供给你在view层自由增加查询的能力?br />
tiger版本仅提供了(jin)dao/service部分Q所以如果你希望在view 查询的安全性方面得到加强,可参考bba96 2.0其中的webwork view部分Q权限部分也没有包含在tiger中,希望快把包括例子的权限部分q移q来Q但q需要一Ҏ(gu)_(d)最q在忙一个CMS的品,旉不够用啊…?/p>

?a class="" title="春天的旁? target="_blank">SpringSide目中webwork MVC部分应用到bba96 tiger对view部分的查询,有兴可以看看,q里也要推荐一?a class="" title="春天的旁? target="_blank">SpringSideQ确实有很多很好的经验在里面可以借鉴?/p>

李李 2006-06-10 19:16 发表评论
]]>
bba96 快速开发框?发布2.0 RC1http://www.aygfsteel.com/scorpio_leon/archive/2006/03/08/34169.html李李李李Tue, 07 Mar 2006 17:24:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2006/03/08/34169.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/34169.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2006/03/08/34169.html#Feedback0http://www.aygfsteel.com/scorpio_leon/comments/commentRss/34169.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/34169.htmlbba96 CHANGELOG
==========================
http://bba96.dev.java.net

Changes in version 2.0 alpha3 (2006.4.3)
*fix action query parameters bug -- [XXX:...]
*fix distinct bug (discard Criteria.DISTINCT_ROOT_ENTITY)
*some minor improvement

Changes in version 2.0 alpha2.2 (2006.3.16)
*update webwork's jar for fixing example bug in weblogic
*remove all contentType setting in example

Changes in version 2.0 alpha2.1 (2006.3.8)
*fix example bug
*update readme.txt

Changes in version 2.0 alpha1 (2006.3.7)
*webwork 2.2 support
*hibernate 3.x support, then support native sql
*fix some bug
*add aop security module
*add action query parameters validation
*enhance action query parameters management
*support more logic in action query
*support multi orderby property


Changes in version 1.0 (2005.09.23)
*release first


源码下蝲Q包含两个快速开发的例子。)(j)
https://bba96.dev.java.net/servlets/ProjectDocumentList?folderID=4149&expandFolder=4149&folderID=0

介参?a href="/scorpio_leon/archive/2005/11/09/18878.aspx">http://www.aygfsteel.com/scorpio_leon/archive/2005/11/09/18878.aspx



李李 2006-03-08 01:24 发表评论
]]>
慎用Webwork的getTextQ用不当效率可能会(x)很低http://www.aygfsteel.com/scorpio_leon/archive/2006/01/21/28871.html李李李李Sat, 21 Jan 2006 05:26:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2006/01/21/28871.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/28871.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2006/01/21/28871.html#Feedback0http://www.aygfsteel.com/scorpio_leon/comments/commentRss/28871.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/28871.html
java doc 如下

Finds a localized text message for the given key, aTextName. Both the key and the message itself is evaluated as required. The following algorithm is used to find the requested message:

  1. Look for message in aClass' class hierarchy.
    1. Look for the message in a resource bundle for aClass
    2. If not found, look for the message in a resource bundle for any implemented interface
    3. If not found, traverse up the Class' hierarchy and repeat from the first sub-step
  2. If not found and aClass is a ModelDriven Action, then look for message in the model's class hierarchy (repeat sub-steps listed above).
  3. If not found, look for message in child property. This is determined by evaluating the message key as an OGNL expression. For example, if the key is user.address.state, then it will attempt to see if "user" can be resolved into an object. If so, repeat the entire process fromthe beginning with the object's class as aClass and "address.state" as the message key.
  4. If not found, look for the message in aClass' package hierarchy.
  5. If still not found, look for the message in the default resource bundles.
  6. Return defaultMessage

主要是查找resource bundleQ下面说明一?BR>1. 先查找该classQ一般我们是在action调用Q就是该action对应的class?jin)?j)对应的properties文gQ找不到再去扑֯应的接口Q找不到再去从该class的承树(wi)上去重复前面的步骤?BR>2. 如果是ModelDriverQ以上找不到再以model的class去重?的步?BR>3.l箋找,如果key是符合ognl表达式还以ognl表达式去解析c,如果能找到类Q还以以上的步骤L?BR>4. q找不到Q就从根据package以及(qing)package的承树(wi)LQ这q包括了(jin)该class的承树(wi)所有的class的package?wi)(q一步存在了(jin)太多的重复查扑ַ作,因ؓ(f)很多package都是相同的)(j)
5 使用默认的resource bundle

java.util.ResourceBundle虽然有cacheQ但是wwZ(jin)减少调用getResourceBundleҎ(gu)Q也l护?jin)一个miss的hashsetQ找不到的bundle name׃q去Q那么每一ơ查N同步?jin)这个missQ如果很多次查找Q开销也是很大的?BR>
我就举一个例子,pW四步查找package?wi)好?BR>

        // nothing still? alright, search the package hierarchy now
        for (Class clazz = aClass;
             (clazz 
!= null&& !clazz.equals(Object.class);
             clazz 
= clazz.getSuperclass()) {

            String basePackageName 
= clazz.getName();
            
while (basePackageName.lastIndexOf('.'!= -1) {
                basePackageName 
= basePackageName.substring(0, basePackageName.lastIndexOf('.'));
                String packageName 
= basePackageName + ".package";
                msg 
= getMessage(packageName, locale, aTextName, valueStack, args);

                
if (msg != null) {
                    
return msg;
                }

                
if (indexedTextName != null) {
                    msg 
= getMessage(packageName, locale, indexedTextName, valueStack, args);

                    
if (msg != null) {
                        
return msg;
                    }
                }
            }
        }

假设你的actionl承?wi)是q样
com.bba96.core.webwork.actions.DefaultActionSupport
com.xxxx.web.actions.XXXActionSupport
com.xxxx.web.user.actions.UserAction
com.xxxx.web.user.ViewUserAction
且不说ww没有判断是否是com.opensymphony.xwork.ActionSupport或者ww的接口就停止Q光是自ql承?wi),?+3+3+3=13ơ,再加上往上的l承?wi)以及(qing)对应的接口Qcom.opensymphony.xwork.ActionSupport以及(qing)Action, Validateable, ValidationAware, TextProvider, LocaleProvider, Serializable, ContinuableObject的接口,查找ơ数过30ơ甚x多,q里的每一ơ都有一个同步miss的过E,开销相当大?BR>
如果你的key所在的resource bundle没有对应到合适的class或packageӞ例如说放在了(jin)default bundle中,ww?x)浪费很多时间。这U情况下Q我在没有ƈ发的时候测?jin)一下,一ơgetText大概耗时40ms左右

所以在实际应用我们应该避免q种情况出现Q要不让resource bundle一一对应classQ要不就自己实现一个简单的getTextQ其实要是ww的ActionSupport的textProvider允许改变最好了(jin)?/P>

李李 2006-01-21 13:26 发表评论
]]>
XP SP2 装IIShttp://www.aygfsteel.com/scorpio_leon/archive/2005/12/21/24999.html李李李李Wed, 21 Dec 2005 15:29:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/12/21/24999.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/24999.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/12/21/24999.html#Feedback3http://www.aygfsteel.com/scorpio_leon/comments/commentRss/24999.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/24999.htmlhttp://support.microsoft.com/?kbid=894351Q根据上面说的,我是属于method 2情况Q但是没有xp原盘Q装的时候就是sp2?jin),又倒…?BR>  最后看到有人情况跟我的cMQ就是用method 1的第一?esentutl /p %windir%\security\database\secedit.sdb 可以了(jin)%windir%那里应该写你的xp安装路径Q不用管什么警告,认对?jin),IIS安装成功……开始配|?/FONT>

李李 2005-12-21 23:29 发表评论
]]>
Webwork2.2的一个改q,Validation/Workflow Interceptor增加excludeMethodsҎ(gu)http://www.aygfsteel.com/scorpio_leon/archive/2005/12/03/22374.html李李李李Sat, 03 Dec 2005 14:29:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/12/03/22374.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/22374.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/12/03/22374.html#Feedback2http://www.aygfsteel.com/scorpio_leon/comments/commentRss/22374.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/22374.html一个例子,原来?/P>
<interceptor-ref name="validation"/>
<interceptor-ref name="workflow"/>

可改写ؓ(f)
<interceptor-ref name="validation">
    <param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>
<interceptor-ref name="workflow">
    <param name="excludeMethods">input,back,cancel</param>
</interceptor-ref>

那么Q对于简单的需验证面Q不需要再因ؓ(f)避免不必要的校验而分两个action?BR>
只有com.opensymphony.xwork.validator.ValidationInterceptor, com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor 定义q实C(jin)q个excludeMethodsQ实现的也还是比较粗p的Q我们在做类似实现的时候可以参考一下,有必要也可以改进Q扩展一下,例如增加includeMethods
    public void setExcludeMethods(String excludeMethods) {
        
this.excludeMethods = TextParseUtil.commaDelimitedStringToSet(excludeMethods);
    }

    
public String intercept(ActionInvocation invocation) throws Exception {
        
if (excludeMethods.contains(invocation.getProxy().getMethod())) {
            log.debug(
"Skipping workflow. Method found in exclude list.");
            
return invocation.invoke();
        }
        
    }


李李 2005-12-03 22:29 发表评论
]]>
BBA96 更新?RC1http://www.aygfsteel.com/scorpio_leon/archive/2005/11/18/20361.html李李李李Fri, 18 Nov 2005 01:37:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/11/18/20361.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/20361.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/11/18/20361.html#Feedback0http://www.aygfsteel.com/scorpio_leon/comments/commentRss/20361.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/20361.htmlhttps://bba96.dev.java.net/servlets/ProjectDocumentList?folderID=4149&expandFolder=4149&folderID=0
修正一处batchRemove的bugQ?BR>action的与持久化相关的Ҏ(gu)Q以?qing)getResultsҎ(gu)保护h
d?jin)一个Book example. 包括单用L(fng)理,书籍的查询与U借?BR>Book Example 参见 http://book.bba96.com
Advanced Example 参见 http://www.gopherbook.com




李李 2005-11-18 09:37 发表评论
]]>
Zhibernate/spring的含RBAC权限模块的快速开发框?目前与webwork整合) http://www.aygfsteel.com/scorpio_leon/archive/2005/11/09/18878.html李李李李Tue, 08 Nov 2005 16:51:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/11/09/18878.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/18878.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/11/09/18878.html#Feedback45http://www.aygfsteel.com/scorpio_leon/comments/commentRss/18878.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/18878.html源文件下?br />https://bba96.dev.java.net/servlets/ProjectDocumentList?folderID=4149&expandFolder=4149&folderID=0


1. 核心(j)持久层部分基于spring/hibernateQ实现强大灵zȝ动态query功能Q可独立使用?br />2. 权限部分Q基于RBACQ支持数据权限,依赖1部分的接口?br />3. Action层,Z1以及(qing)webworkQ良好架构,减少大量代码Q支持view灉|q行query且有参数教验支持保证安全性?br />
单说bba96是Zhibernate/spring的快速开发框Ӟ其中包含?jin)对Hibernate CritieraQProjection的封装,通过一个强大而灵zȝQueryObject对象Q方便动态添加与删除条g?br />通过l一的query与数据库交互Q方便AOPQ其中的RBAC权限模块Q支持数据权限)(j)x通过AOP操作Q(jng)ueryObject对象来实现的。bba96核心(j)可以跟流行的view整合Q目前只有webwork整合的版本?br />
bba96 不再需要自己写DAO/SERVICEQ借助单的spring ioc卛_配置使用~省DAO/SERVICEQ而且通过灉|方便Q易扩展的后台持久层与webwork的整合,完全实现?jin)快速开发的目的?br />

Get Up And Running Quick

Example:
   (1) enter the example/simple or emample/book folder.
       NOTE:all following operation is under the folder you entered
   (2) copy your JDBC driver (default mysql) to the lib directory
       -- webapps\ROOT\WEB-INF\lib
   (3) edit hibernate.properties for database info (default mysql)
       -- src\main\java\hibernate.properties
   (4) run "ant"
   (5) create database via the sql script generated at database\schema-export.sql
   (6) edit applicationContext.xml for database info (default mysql)
       -- webapps\ROOT\WEB-INF\applicationContext.xml (line 5 - 21)
   (7) start server and see this example


有用上的讨论,误pL MSN: hotmail的帐号scorpio_leon


李李 2005-11-09 00:51 发表评论
]]>
开始尝?Webwork 2.2, 一些容易出错的地方 -- 持箋更新http://www.aygfsteel.com/scorpio_leon/archive/2005/10/19/15933.html李李李李Wed, 19 Oct 2005 07:36:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/19/15933.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/15933.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/19/15933.html#Feedback1http://www.aygfsteel.com/scorpio_leon/comments/commentRss/15933.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/15933.html
  • 如果你用hibernate+springQ注意spring的OpenSessionInView的Filter要在webwork的Filter之前
  • ww:propertyq个tag~省是escape html的,在tag可以指定escape="false"避免html字符转义
  • 一些原来用单引可C字W串的都要去掉单引号Q例?" 'test' "  要改?"test"
  • No object in the CompoundRoot has a property namedQ这是由于在webwork.properties讄?jin)webwork.devMode=trueQ会(x)(g)查页面上传递过来的参数是否在action定义q?/LI>

    李李 2005-10-19 15:36 发表评论
    ]]>Webwork 2.1.7 的一个小~陷http://www.aygfsteel.com/scorpio_leon/archive/2005/10/18/15831.html李李李李Tue, 18 Oct 2005 10:22:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/18/15831.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/15831.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/18/15831.html#Feedback1http://www.aygfsteel.com/scorpio_leon/comments/commentRss/15831.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/15831.htmlpublic interface ModelDriven {
        Object getModel();
    }

    而我需要的?
    public interface ModelDriven {
        Object getModel() 
    throws Exception;
    }

    因ؓ(f)要拦截可能抛出的异常Q流E是q样service - my service interceptor - action - xwork interceptor
    现在断在actionq里?jin),很奇怪,webwork其他Ҏ(gu)都有throw exceptionQ独独这个没有,N又要hack webworkQ?BR>恩,有了(jin)AOP后,接口设计应该要多考虑一下,是否允许抛出异常…?/P>

    李李 2005-10-18 18:22 发表评论
    ]]>
    单实现异步Email -- Jakarta Common Email l合 Opensymphony Quartzhttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/15/15603.html李李李李Sat, 15 Oct 2005 14:01:00 GMThttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/15/15603.htmlhttp://www.aygfsteel.com/scorpio_leon/comments/15603.htmlhttp://www.aygfsteel.com/scorpio_leon/archive/2005/10/15/15603.html#Feedback0http://www.aygfsteel.com/scorpio_leon/comments/commentRss/15603.htmlhttp://www.aygfsteel.com/scorpio_leon/services/trackbacks/15603.html看看下面的应用例子,E序执行三秒后会(x)在后台开始发EmailQ只有几行程序,很简单吧?BR>本来应该这么简单,q能再省么,呵呵Q谢谢开源的力量…?BR>

        SimpleEmail email = new SimpleEmail();
        email.addTo(
    "receiver@somemail.com""Receier's Name");
        email.setSubject(
    "Email from www.bba96.com");
        email.setMsg(
    "Hello, guy!");
        EmailScheduler emailScheduler 
    = new EmailScheduler();
        emailScheduler.process(email);

    q里用到?A >jakarta common email中的SimpleEmail
    EmailScheduler是一个利?A >Opensymphony Quartz做简单的调度Q其中EmailJob实现?jin)Quartz的Job接口
    以下是EmailScheduler以及(qing)EmailJob源代码?/P>

    package com.bba96.scheduler;

    import java.util.Date;

    import javax.mail.Authenticator;

    import org.apache.commons.mail.Email;
    import org.quartz.JobDetail;
    import org.quartz.Scheduler;
    import org.quartz.SchedulerException;
    import org.quartz.SchedulerFactory;
    import org.quartz.SimpleTrigger;

    public class EmailScheduler {

        
    public void process(Email email, Authenticator authenticator)
                
    throws SchedulerException {
            
    // TODO if can be optimized with static instance.
            SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
            Scheduler sched 
    = schedFact.getScheduler();
            sched.start();

            JobDetail jobDetail 
    = new JobDetail("EmailJob"null, EmailJob.class);
            jobDetail.getJobDataMap().put(EmailJob.EMAIL, email);
            jobDetail.getJobDataMap().put(EmailJob.AUTHENTICATIOR, authenticator);
            
    //Create a trigger that fires exactly once, three seconds from now
            long startTime = System.currentTimeMillis() + 3000L;
            SimpleTrigger trigger 
    = new SimpleTrigger("emailTrigger"null,
                    
    new Date(startTime), null00L);
            sched.scheduleJob(jobDetail, trigger);
        }

        
    public void process(Email email) throws SchedulerException {
            process(email, 
    null);
        }

    }

     

    package com.bba96.scheduler;

    import javax.mail.Authenticator;

    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.apache.commons.mail.DefaultAuthenticator;
    import org.apache.commons.mail.Email;
    import org.apache.commons.mail.EmailException;
    import org.quartz.Job;
    import org.quartz.JobExecutionContext;
    import org.quartz.JobExecutionException;

    public class EmailJob implements Job {

        
    protected final Log logger = LogFactory.getLog(EmailJob.class);

        
    public static String EMAIL = "EMAIL";

        
    public static String AUTHENTICATIOR = "AUTHENTICATIOR";

        
    public static String DEFAULT_HOST = "your smtp mail server";

        
    public static int DEFAULT_SMTP_PORT = 25;

        
    public static String DEFAULT_USER = "yourmail@yourserver.com";

        
    public static String DEFAULT_PASSWORD = "your password";

        
    public static String DEFAULT_FROM_ADDRESS = "yourmail@yourserver.com";

        
    public static String DEFAULT_FROM_NAME = "Your Name";

        
    public void execute(JobExecutionContext context)
                
    throws JobExecutionException {
            Email email 
    = (Email) context.getJobDetail().getJobDataMap().get(EMAIL);
            
    if (email != null) {
                Authenticator authenticator 
    = (Authenticator) context
                        .getJobDetail().getJobDataMap().get(AUTHENTICATIOR);
                
    if (email.getHostName() == null) {
                    email.setHostName(DEFAULT_HOST);
                }
                
    if (email.getSmtpPort() == null) {
                    email.setSmtpPort(DEFAULT_SMTP_PORT);
                }
                
    if (authenticator == null) {
                    authenticator 
    = new DefaultAuthenticator(DEFAULT_USER,
                            DEFAULT_PASSWORD);
                    email.setAuthenticator(authenticator);
                }
                
    if (email.getFromAddress() == null) {
                    
    try {
                        email.setFrom(DEFAULT_FROM_ADDRESS, DEFAULT_FROM_NAME);
                    } 
    catch (EmailException e) {
                        logger.error(
    "Email address invalid", e);
                        
    return;
                    }
                }
                
    try {
                    email.send();
                } 
    catch (EmailException e) {
                    logger.error(
    "Email send error", e);
                }
            }
        }

    }



    李李 2005-10-15 22:01 发表评论
    ]]>
    վ֩ģ壺 ɳ| | | Ȩ| | ԰| ޵| | | | | Ϫ| ϻ| | | | | | | | | | ٤ʦ| | Զ| | ۳| | ɳ| Ϫ| | | Ӣ| ո| ˳| | ʱ| | | | մ|