Created
July 11, 2013 08:30
-
-
Save arganzheng/5973610 to your computer and use it in GitHub Desktop.
可以使用这个ok.jsp检查应用是否正常启动
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@page import="org.springframework.web.context.WebApplicationContext"%> | |
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%> | |
<%@page import="org.springframework.web.context.support.XmlWebApplicationContext"%> | |
<% | |
XmlWebApplicationContext context = (XmlWebApplicationContext)WebApplicationContextUtils.getWebApplicationContext(application); | |
try{ | |
if(!context.isActive()){ | |
context.refresh(); | |
} | |
out.write("ok"); | |
}catch(Exception e){ | |
out.write("failure"); | |
throw e; | |
} | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最好把IP地址也打出来:)