Java spring如何在没有db连接的情况下注销
我有一个像这样的主页,它有一个iframeJava spring如何在没有db连接的情况下注销,java,spring,spring-mvc,iframe,exception-handling,Java,Spring,Spring Mvc,Iframe,Exception Handling,我有一个像这样的主页,它有一个iframe <iframe id="contentframe" name="contentframe" src="Report.html" style="height: 99%; width: 100%;" frameborder="0" > </iframe> 但是当数据库连接在处理Report.html请求时丢失时,Login.jsp将在iframe中加载。我希望它作为整个页面加载到iframe之外 非常感谢您的帮助。
<iframe id="contentframe" name="contentframe" src="Report.html"
style="height: 99%; width: 100%;" frameborder="0" >
</iframe>
但是当数据库连接在处理Report.html
请求时丢失时,Login.jsp
将在iframe中加载。我希望它作为整个页面加载到iframe之外
非常感谢您的帮助。您需要找到检测iframe更改的方法。这是一个html/javascript问题。test()@Sotirios Delimanolis中的代码是什么?只有当出现异常时,才会出现响应。您必须在javascript的测试方法中处理它
onload=“test()”
尝试查找iframe location.href,如果是login.jsp,则尝试使用location再次将整个页面重定向到login.jsp。href@styatest()有用于格式化内容文本的js代码,我认为这不会影响任何内容
@ExceptionHandler(Exception.class)
public ModelAndView handleAllException(Exception ex) {
ModelAndView mv=new ModelAndView("Login");
mv.addObject("loginForm", new LoginForm());
mv.addObject("loginMsg", "No Database Connection");
return mv;
}