001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/RequestProcessorDefault.java,v 1.8 2007/10/09 11:09:22 lexuanttkhtn Exp $
003: * $Author: lexuanttkhtn $
004: * $Revision: 1.8 $
005: * $Date: 2007/10/09 11:09:22 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding mvnForum MUST remain
012: * intact in the scripts and in the outputted HTML.
013: * The "powered by" text/logo with a link back to
014: * http://www.mvnForum.com and http://www.MyVietnam.net in
015: * the footer of the pages MUST remain visible when the pages
016: * are viewed on the internet or intranet.
017: *
018: * This program is free software; you can redistribute it and/or modify
019: * it under the terms of the GNU General Public License as published by
020: * the Free Software Foundation; either version 2 of the License, or
021: * any later version.
022: *
023: * This program is distributed in the hope that it will be useful,
024: * but WITHOUT ANY WARRANTY; without even the implied warranty of
025: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026: * GNU General Public License for more details.
027: *
028: * You should have received a copy of the GNU General Public License
029: * along with this program; if not, write to the Free Software
030: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
031: *
032: * Support can be obtained from support forums at:
033: * http://www.mvnForum.com/mvnforum/index
034: *
035: * Correspondence and Marketing Questions can be sent to:
036: * info at MyVietnam net
037: *
038: * @author: Luis Miguel Hernanz
039: * @author: Minh Nguyen
040: */
041: package com.mvnforum;
042:
043: import java.io.UnsupportedEncodingException;
044: import javax.servlet.http.HttpServletRequest;
045: import javax.servlet.http.HttpServletResponse;
046:
047: import org.apache.commons.logging.Log;
048: import org.apache.commons.logging.LogFactory;
049:
050: /**
051: * Empty implementation of the RequestProcessor interface.
052: *
053: * @author <a href="luish@germinus.com">Luis Miguel Hernanz</a>
054: * @version $Revision: 1.8 $
055: */
056: public class RequestProcessorDefault implements RequestProcessor {
057:
058: private static Log log = LogFactory
059: .getLog(RequestProcessorDefault.class);
060:
061: /**
062: * This is the first method called in the request processing. This
063: * method returns always <code>null</code>.
064: *
065: * @param request a <code>HttpServletRequest</code> value
066: * @param response a <code>HttpServletResponse</code> value
067: */
068: public String preLogin(HttpServletRequest request,
069: HttpServletResponse response) {
070: try {
071: request.setCharacterEncoding("utf-8");
072: } catch (UnsupportedEncodingException e) {
073: log
074: .warn(
075: "Error setting the character encoding from the request",
076: e);
077: }
078: return null;
079: }
080:
081: /**
082: * The method receives the user request just before the
083: * authentication has been checked. This method always returns
084: * <code>null</code>.
085: *
086: * @param request a <code>HttpServletRequest</code> value
087: * @param response a <code>HttpServletResponse</code> value
088: */
089: public String preProcess(HttpServletRequest request,
090: HttpServletResponse response) {
091: return null;
092: }
093:
094: /**
095: * This method is called just before the call to the final request
096: * dispatcher forward. This method always returns
097: * <code>responseURI</code>.
098: *
099: * @param request a <code>HttpServletRequest</code> value
100: * @param response a <code>HttpServletResponse</code> value
101: * @param responseURI the path to which the control will be
102: * forwarded after this method has finished.
103: */
104: public String postProcess(HttpServletRequest request,
105: HttpServletResponse response, String responseURI) {
106: return responseURI;
107: }
108: }
|