openLaszlo简单登陆窗口实现

 laszlo 部分
<? xml version="1.0" encoding="GB2312" ?>
< canvas  bgcolor ="0xEAEAEA"  height ="600"  width ="800"
    oninit
="quest.setAttribute('haswindowfocus', true)" >
    
< silverstyle  isdefault ="true"  canvascolor ="null" />
    
< bluestyle  name ="bluecolors"  canvascolor ="null" />
    
< goldstyle  name ="goldcolors"  canvascolor ="null" />
    
    
< dataset  name ="checker"  src ="check.jsp"  type ="http" />

< modaldialog  id ="letmein"  height ="200"  width ="300"  x ="180"  y ="100"  style ="bluecolors" >
    
< animator  name ="fadein"  attribute ="opacity"   from ="0"  to ="1"   duration ="500"  start ="false" />
        
< method  name ="doAfter" >
            quest.fadein.doStart();
            bye.setAttribute('text','再见');
        
</ method >
    
< form  id ="loginform" >
    
< submit  name ="doSubmit"  data ="${checker}" />
    
< view  id ="loginmain"  align ="center"  layout ="axis: y; spacing: 20" >
        
< view  layout ="axis: x; spacing: 5" >
            
< text  y ="2"   > 用户: </ text >
            
< edittext  width ="120"  id ="username"  name ="username" > 哈哈 </ edittext >
        
</ view >
        
< view  layout ="axis: x; spacing: 5" >
            
< text  y ="2"   > 密码: </ text >
            
< edittext  id ="password"  width ="120"  name ="password" > 123 </ edittext >
        
</ view >
        
< view  align ="center"  layout ="axis:x; spacing:20"  y ="150" >
              
< button > 确认
                
< method  event ="onclick" >
                    loginform.doSubmit.submit();
                
</ method >
              
</ button >
              
< button > 取消
                
< method  event ="onclick" >
                    letmein.close();
                    letmein.doAfter();
                
</ method >
              
</ button >
        
</ view >
    
< datapointer  id ="respoint"  xpath ="checker:/response" >
        
< method  event ="ondata" >
            if (this.xpathQuery("/response/text()")=="ok") {
                letmein.close();
                quest.fadein.doStart();
                bye.setAttribute('text','欢迎'+username.getText());
                quest.out();
            }
            else
                err.open();
        
</ method >
    
</ datapointer >
    
</ view >
    
</ form >
</ modaldialog >
< alert  id ="err" > 密码错误! </ alert >
< window  style ="goldcolors"  id ="quest"  title ="神秘地带"
            x
="100"  y ="40"  width ="500"  height ="300"  resizable ="true" >
    
< animator  name ="fadeout"  attribute ="opacity"   to =".15"   duration ="500"  start ="false" />
    
< animator  name ="fadein"  attribute ="opacity"   from =".15"  to ="1"   duration ="500"  start ="false" />
    
< animator  name ="leftesc"  attribute ="x"  from ="100"  to ="-900"  duration ="200"  start ="false" />
    
< method  event ="oninit" >
        this.logonDelegate = new LzDelegate(this, "logonmethod" );
        LzTimer.addTimer( this.logonDelegate, 2000 );
    
</ method >
    
< method  name ="logonmethod" >
        this.fadeout.doStart();
        letmein.open();
        letmein.fadein.doStart();
    
</ method >
    
< method  name ="out" >
        this.leftescDelegate = new LzDelegate(this, "leftout" );
        LzTimer.addTimer( leftescDelegate, 5000 );
    
</ method >
    
< method  name ="leftout" >
            quest.leftesc.doStart();
            quest.destory();
    
</ method >
    
< view  x ="${(immediateparent.width / 2) 
                       - (this.width / 2)}"
 y ="${(immediateparent.height / 2) 
                       - (this.height / 2)}"
>
        
< text  id ="bye"  fontsize ="40"  width ="300" ></ text >
    
</ view >
</ window >
</ canvas >

check.jsp部分
<? xml version="1.0" encoding="GBK" ?>
<% @ page import="java.util.*"  %>
<% @ page contentType="text/xml; charset=GBK"  %>

< response >
<%
    
String user = request.getParameter("username");
    
String password = request.getParameter("password");
    
String uuser = new String(user.getBytes("8859_1"), "UTF-8");
    
if(uuser.equals("haha")&&password.equals("123"))
        out.print(
"ok");
%>
</ response >

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值