FileDocCategorySizeDatePackage
CustomRequestProcessor1.javaAPI DocExample965Fri Sep 03 10:33:16 BST 2004com.oreilly.strutsckbk.ch11

CustomRequestProcessor1

public class CustomRequestProcessor1 extends org.apache.struts.action.RequestProcessor

Fields Summary
Constructors Summary
Methods Summary
protected booleanprocessPreprocess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

        HttpSession session = request.getSession();
        User user = (User) session.getAttribute(Constants.USER_KEY);
        if (user == null) {
            try {
                response.sendError(403, "User not logged in");
            } catch (IOException e) {
                log.error("Unable to send response");
            }
            return false;
        }
        
        return true;