Advertisement
Guest User

Untitled

a guest
May 5th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  2. HttpServletResponse hsr = (HttpServletResponse) res;
  3. HttpServletRequest hreq = (HttpServletRequest) req;
  4.  
  5. HttpSession session = hreq.getSession(false);
  6.  
  7. if(session == null) {
  8. hsr.sendRedirect("/prj1/sessionexpiry");
  9. return;
  10. } else {
  11. chain.doFilter(req, res);
  12. }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement