zk异步请求异常,自定义错误页面的bug
程序员文章站
2022-07-13 21:46:48
...
zk版本5.0.6
但当au request发生异常的时候,却弹出了两个对话框
一个是zk默认的错误对话框(a),标题为zk的错误框
然后才是我自定义的对话框(b)
(a)在最前面,(b)最后面,
按照上面的2中的做法,不应该有(a)这个对话框的
错误截图
error.zul页面
- <? xml version = "1.0" encoding = "UTF-8" ?>
- < window xmlns:n = "native" xmlns = "http://www.zkoss.org/2005/zul"
- xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation = "http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd"
- mode = "modal" closable = "true" width = "300px" height = "200px" >
- < caption >
- < div align = "left" >
- < label value = "系统错误" style = "color:red;" > </ label >
- </ div >
- </ caption >
- < n:div style = "color: #CE4614;font-size: 0.9em;text-align: center;"
- align = "center" >
- < n:h3 style = "font-size:1.4em;" > 抱歉,系统错误 </ n:h3 >
- 我们已记录该错误,为此造成您的不便请多见谅
- < n:br />
- < n:br />
- < n:br />
- < button label = "确定" onClick = "spaceOwner.detach();" />
- </ n:div >
- < zscript >
- <![CDATA[
- if(requestScope.get("javax.servlet.error.exception")!=null){
- org.slf4j.Logger log=org.slf4j.LoggerFactory.getLogger("syserror.zul");
- log.error("system error", requestScope.get("javax.servlet.error.exception"))
- }
- ]]>
- </ zscript >
- </ window >
<?xml version="1.0" encoding="UTF-8"?> <window xmlns:n="native" xmlns="http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd" mode="modal" closable="true" width="300px" height="200px"> <caption> <div align="left"> <label value="系统错误" style="color:red;"></label> </div> </caption> <n:div style="color: #CE4614;font-size: 0.9em;text-align: center;" align="center"> <n:h3 style="font-size:1.4em;">抱歉,系统错误</n:h3> 我们已记录该错误,为此造成您的不便请多见谅 <n:br /> <n:br /> <n:br /> <button label="确定" onClick="spaceOwner.detach();" /> </n:div> <zscript> <![CDATA[ if(requestScope.get("javax.servlet.error.exception")!=null){ org.slf4j.Logger log=org.slf4j.LoggerFactory.getLogger("syserror.zul"); log.error("system error", requestScope.get("javax.servlet.error.exception")) } ]]> </zscript> </window>
上一篇: mvn install 报错
下一篇: mvn install 报错
推荐阅读