jsp为什么刷新页面会自动提交form
- 提问者网友:练爱
- 2021-07-24 22:31
- 五星知识达人网友:轮獄道
- 2021-07-24 23:54
楼上说的不对,如果没有放刷新的话,必定会这样。。。
给你个放刷新代码吧。。
package com.dali.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class DaliFilter implements Filter{
public void destroy() {
}
public void doFilter(ServletRequest req, ServletResponse rep,
FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) rep;
HttpServletRequest request = (HttpServletRequest) req;
HttpSession session = request.getSession();
//String op = (String)req.getAttribute("op");
if(session != null) {
chain.doFilter(req, rep);
}else {
response.sendRedirect("login.mvc");
return;
}
}
public void init(FilterConfig config) throws ServletException {
}
}
- 1楼网友:一叶十三刺
- 2021-07-25 02:47
- 2楼网友:雪起风沙痕
- 2021-07-25 01:16
肯定是设置了某个标签的 onload属性了 ,你找找
如<body onload=function(){......;}>