页面过期的问题!可以在页面上判断一下就可以了!
比如写一个Tag:
部分代码如下:
public int doEndTag() throws JspException {
// Is there a valid user logged on?
boolean valid = false;
HttpSession session = pageContext.getSession();
if ((session != null) && (session.getAttribute(name) != null)) {
valid = true;
}
// Forward control based on the results
if (valid) {
return (EVAL_PAGE);
} else {
ModuleConfig config =
(ModuleConfig) pageContext.getServletContext().getAttribute(
org.apache.struts.Globals.MODULE_KEY);
try {
pageContext.forward(config.getPrefix() + page);
// pageContext.forward(config.getPrefix() + page+(forward!=null?("?forward="+forward):""));
} catch (ServletException e) {
throw new JspException(e.toString());
} catch (IOException e) {
throw new JspException(e.toString());
}
return (SKIP_PAGE);
}
}
比如写一个Tag:
部分代码如下:
public int doEndTag() throws JspException {
// Is there a valid user logged on?
boolean valid = false;
HttpSession session = pageContext.getSession();
if ((session != null) && (session.getAttribute(name) != null)) {
valid = true;
}
// Forward control based on the results
if (valid) {
return (EVAL_PAGE);
} else {
ModuleConfig config =
(ModuleConfig) pageContext.getServletContext().getAttribute(
org.apache.struts.Globals.MODULE_KEY);
try {
pageContext.forward(config.getPrefix() + page);
// pageContext.forward(config.getPrefix() + page+(forward!=null?("?forward="+forward):""));
} catch (ServletException e) {
throw new JspException(e.toString());
} catch (IOException e) {
throw new JspException(e.toString());
}
return (SKIP_PAGE);
}
}
解决方案 »
- 求指点!! 解压zip出现乱码!!!!
- 跳转错误
- 刚刚学习Jsp 谁能说说JavaBean连接数据库跟Servlet连接数据库有什么区别吗
- 请高手指教 如何在WebSphere6.1 下发布我的工程
- 在程序里怎么给交叉报表(JasperReport)传递参数?
- 一个Tomcat+servlet的问题!!!!!急哦!!!!!!!!
- portlet调用问题
- struts 页面跳转问题!
- 求助关于struts表单
- 有一小问题,请高手赐教
- !!!!!!!!!JDBC2.0的问题,急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 解析XML问题
response.addHeader("Cache-Control", "no-cache");
response.addHeader("Expires","Thu, 01 Jan 1970 00:00:01 GMT");
可还是不成?