^1640740804102
@
sname
LoginExample
slabel
LoginExample
scheckPermission
false
scheckLogin
false
sdescriptors
xworker.web.controls.SimpleControl
sinheritDescription
false
sth_createIndex
false
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
  @/@actions
  sname
  actions
  sdescriptors
  xworker.web.controls.SimpleControl/@actions
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  actions
    @/@actions/@doAtction
    sname
    doAction
    sisSynchronized
    false
    sthrowException
    true
    suseOtherAction
    false
    svarScope
    Local
    sdisableGlobalContext
    false
    Scode
#$@text#$@
//动作
def action = requestBean.action;
def sessionName = self.getMetadata().getPath();

//退出
if(action == "logout"){
    //清除session缓存
    session.setAttribute(sessionName, null);
    
    //显示登录界面
    return "login";
}else{
    if(session.getAttribute(sessionName) != null){
        //已登录
        return "logined";
    }else{
        //登陆
        def name = requestBean.name;
        def password = requestBean.password;
        
        if(name == "admin" && password == "admin"){
            session.setAttribute(sessionName, "admin");
            return "logined";
        }else{
             actionContext.getScope(0).put("message", "please input admin/admin");
             return "login";
        }
    }
}
#$@text#$@
    sinterpretationType
    Action
    screateLocalVarScope
    false
    ssaveReturn
    false
    sdebugLog
    false
    sdescriptors
    xworker.lang.actions.Actions/@GroovyAction
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    doAtction
  @/@view
  sname
  loginPage
  sbelongToHtml
  false
  stitle
  Login
  sstyle
  default
  shasHead
  false
  shasBottom
  false
  snoCache
  false
  SotherHeads
#$@text#$@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<LINK REL ="stylesheet" TYPE="text/css" HREF="fckeditor/2_6beta1/editor/css/fck_editorarea.css" TITLE="Style"/>
<script type="text/javascript" src="js/xworker/InnerBrowserUtil.js"></script>
#$@text#$@
  sdescriptors
  xworker.web.controls.SimpleControl/@view
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  view
    @/@view/@SimpleLoginPage
    sname
    SimpleLoginPage
    stitle
    Login Test
    scompany
    xworker.org
    slogo
    /images/logo.png
    sloginUrl
    do?sc=xworker.example.web.login.LoginExample
    sformContents
    <input type="hidden" name="aname"/>
    sdescriptors
    xworker.web.app.view.http.app.page.SimpleLoginPage
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    SimpleLoginPage
  @/@loginedPage
  sname
  loginedPage
  sbelongToHtml
  true
  stitle
  Welcome
  sstyle
  default
  shasHead
  false
  shasBottom
  false
  snoCache
  false
  SotherHeads
#$@text#$@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<LINK REL ="stylesheet" TYPE="text/css" HREF="fckeditor/2_6beta1/editor/css/fck_editorarea.css" TITLE="Style"/>
<script type="text/javascript" src="js/xworker/InnerBrowserUtil.js"></script>
#$@text#$@
  sdescriptors
  xworker.web.controls.SimpleControl/@view
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  loginedPage
    @/@loginedPage/@htmlCode
    sname
    htmlCode
    ShtmlCode
#$@text#$@
<h3>Welcome!</h3>

<p><a href="do?sc=xworker.example.web.login.LoginExample&amp;action=logout">logout</a> <a href="do?sc=xworker.example.web.login.SimpleControlCheckLogin">SimpleControl CheckLogin</a></p>
#$@text#$@
    sdescriptors
    xworker.html.base.container.childs/@htmlCode
    sinheritDescription
    false
    sth_createIndex
    false
    sth_registMyChilds
    false
    sth_registDisabled
    false
    sth_mark
    false
    sid
    htmlCode
  @/@login
  sname
  login
  stype
  form
  scontentType
  text/html;charset=UTF-8
  svalue
  xworker.example.web.login.LoginExample/@view
  sdescriptors
  xworker.web.controls.SimpleControl/@result
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  login
  @/@logined
  sname
  logined
  stype
  form
  scontentType
  text/html;charset=UTF-8
  svalue
  xworker.example.web.login.LoginExample/@loginedPage
  sdescriptors
  xworker.web.controls.SimpleControl/@result
  sinheritDescription
  false
  sth_createIndex
  false
  sth_registMyChilds
  false
  sth_registDisabled
  false
  sth_mark
  false
  sid
  logined
