这种应该在客户端处理,使用ajax请求,设置超时时间,过时跳转。 非要在web服务器处理,不管是tomcat还是nginx都不能实现你的要求。 还有一种比较扯淡的做法,你在拦截器里把请求转给httpclient处理,它可以设置超时时间,超时再跳转,但我相信兄弟 你不会这么做的吧!
[quote=引用 2 楼 li272355201 的回复:] [quote=引用 1 楼 defonds 的回复:] 是 tomcat7 吗?可以这样试试: <Context ...> ... <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> ... </Context>
<Context ...> ... <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> ... </Context>
是 tomcat7 吗?可以这样试试: <Context ...> ... <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> ... </Context>
[quote=引用 1 楼 defonds 的回复:] 是 tomcat7 吗?可以这样试试: <Context ...> ... <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" /> ... </Context>
aop 拦截 加入定时器1秒执行一次,调用方法时间。和当前时间如果超过一定时间直接return 到自己的页面。
写个filter就行.
81,090
社区成员
341,731
社区内容
加载中
试试用AI创作助手写篇文章吧