struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Maurer <joerg.mau...@ucpmorgen.com>
Subject RE: Extending the RequestProcessor class
Date Sat, 08 Feb 2003 16:55:01 GMT
Don't want to be that a wacky answer, but I read the source - only free
hotspot for myself newby-level seemed to be (quoting
org.apache.struts.action.RequestProcessor):

    /**
     * General-purpose preprocessing hook that can be overridden as
required
     * by subclasses.  Return <code>true</code> if you want standard
processing
     * to continue, or <code>false</code> if the response has already
been
     * completed.  The default implementation does nothing.
     *
     * @param request The servlet request we are processing
     * @param response The servlet response we are creating
     */
    protected boolean processPreprocess(HttpServletRequest request,
                                        HttpServletResponse response) {

        return (true);

    }

...where myself subclassing had put sth like sample from book
"Programming Struts" :

  protected boolean processPreprocess( HttpServletRequest request,
                                      HttpServletResponse response){

    HttpSession userSession = request.getSession(false);
    // Check to see if there's a session for the user that wasn't just
created (or if he didn´t logged out - ? does session invalidate on his
browser as well ?)
    UserContainer uc =
(UserContainer)userSession.getAttribute(IAppConstants.USER_CONTAINER_KEY
);
    if ( uc == null || userSession == null || userSession.isNew()){
      //continueProcessing = false;
      try{
        userSession.invalidate();
        userSession = request.getSession(true); 
        ApplicationContainer ac =
(ApplicationContainer)userSession.getServletContext().getAttribute(IAppC
onstants.APPLICATION_CONTAINER_KEY);
        userSession.setAttribute(IAppConstants.USER_CONTAINER_KEY, new
UserContainer(ac));
        response.sendRedirect( "/index.jsp" );
        return false;
      }catch( Exception ex ){
        ex.printStackTrace();
      }
    }
    return true;
  }

-----Original Message-----
From: John D. Dubchak [mailto:jdubchak@qwest.net]
Sent: Samstag, 08. Februar 2003 18:00
To: struts-user@jakarta.apache.org
Subject: Extending the RequestProcessor class


Hi,

I've been searching through the documentation to find information on
extending 
the RequestProcessor class but can't seem to find it.  Can someone point
me 
in the right direction?

Thanks in advance,
John

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message