AdmMono/web/login.zul

72 lines
2.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winLogin"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:w="http://www.zkoss.org/2005/zk/client"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<window id="winLogin" title="${c:l('winLogin.title')}" border="normal" width="400px" closable="false" position="center"
mode="overlapped" onCreate="u.focus()">
<h:form id="f" name="f" action="j_spring_security_check" method="POST" xmlns:h="http://www.w3.org/1999/xhtml">
<grid w:onOK="validate()">
<rows>
<row align="left">
<label value="${c:l('winLogin.lblUsuario')}" />
<hbox align="center">
<image src="/gui/img/user24.png" />
<textbox id="u" name="j_username" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
</hbox>
</row>
<row align="left">
<label value="${c:l('winLogin.lblSenha')}" />
<hbox align="center">
<image src="/gui/img/pass24_4.png" />
<textbox id="p" type="password" name="j_password" constraint="no empty" />
</hbox>
</row>
<row spans="2" align="center">
<hbox align="center">
<h:input type="button" value="${c:l('winLogin.btnAcessar')}" w:onClick="validate()" />
</hbox>
</row>
</rows>
</grid>
</h:form>
<script type="text/javascript">
function validate() {
var pwd = jq('$p').val() == '';
var name = jq('$u').val() == '';
var ok = 1;
if (name == true){
ok = 0;
}
if (pwd == true){
ok = 0;
}
if(ok == 1){
jq('$f').submit();
}
}
</script>
<zscript>
//System.out.println("gleimar="+Executions.getCurrent().getSession().getAttribute(org.springframework.security.web.authentication.AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY));
Exception exep = Executions.getCurrent().getSession().getAttribute(org.springframework.security.web.authentication.AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY);
if (exep != null ){
Clients.alert(org.zkoss.util.resource.Labels.getLabel("winLogin.lblloginIncorreto"),
org.zkoss.util.resource.Labels.getLabel("winLogin.title"), Messagebox.INFORMATION);
}
</zscript>
</window>
</zk>