您的位置:首页 >> 编程开发 >> Java >> JavaBeans >> 正文
RSS
 

Petstore源码追踪记(3)-商业逻辑处理(三)

http://www.rdxx.com 01年11月18日 11:08 互联网 我要投稿

关键词: 商业 , 逻辑 , Stor

                        cookies[loop].setMaxAge(0);
                        hres.addCookie(cookies[loop]);

                    }
                }
            }
        }
        //透过EJB数据库读取资料进行比对
        //validate against the registered users
        SignOnLocal signOn = getSignOnEjb();
    //请加入侦察程序代码,方便稍候程序验证
    System.out.println("进行EJB tier使用者验证");
        //
帐号及密码验证
        boolean authenticated = signOn.authenticate(userName, password);
        if (authenticated) {
            //
验证成功则将使用者帐号(USER_NAME)及是否已登入(SIGNED_ON_USER)参数
存入Session
            // place a true boolean in the session
            if (hreq.getSession().getAttribute(USER_NAME) != null) {
                hreq.getSession().removeAttribute(USER_NAME);
            }
            hreq.getSession().setAttribute(USER_NAME, userName);
            // remove the sign on user key before putting it back in
            if (hreq.getSession().getAttribute(SIGNED_ON_USER) != null) {
                hreq.getSession().removeAttribute(SIGNED_ON_USER);
            }
            hreq.getSession().setAttribute(SIGNED_ON_USER, new Boolean(true));
//
将网页转导就会到达我们的目的地-使用者基本资料浏览画面(customer.do)
            // redirect to the original destination
            String targetURL =
(String)hreq.getSession().getAttribute(ORIGINAL_URL);
            hres.sendRedirect(targetURL);
            return;
        } else {
9 7 3 1 2 3 4 4 8 :

 
 
标签: 商业 , 逻辑 , Stor 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站