001: /*
002: * $Header: /cvsroot/mvnforum/myvietnam/src/net/myvietnam/mvncore/service/impl/URLResolverServiceImplServletDefault.java,v 1.1 2007/05/04 18:43:54 minhnn Exp $
003: * $Author: minhnn $
004: * $Revision: 1.1 $
005: * $Date: 2007/05/04 18:43:54 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding MyVietnam and MyVietnam CoreLib
012: * MUST remain intact in the scripts and source code.
013: *
014: * This library is free software; you can redistribute it and/or
015: * modify it under the terms of the GNU Lesser General Public
016: * License as published by the Free Software Foundation; either
017: * version 2.1 of the License, or (at your option) any later version.
018: *
019: * This library is distributed in the hope that it will be useful,
020: * but WITHOUT ANY WARRANTY; without even the implied warranty of
021: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
022: * Lesser General Public License for more details.
023: *
024: * You should have received a copy of the GNU Lesser General Public
025: * License along with this library; if not, write to the Free Software
026: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
027: *
028: * Correspondence and Marketing Questions can be sent to:
029: * info at MyVietnam net
030: *
031: * @author: Minh Nguyen
032: */
033: package net.myvietnam.mvncore.service.impl;
034:
035: import javax.servlet.http.HttpServletRequest;
036: import javax.servlet.http.HttpServletResponse;
037:
038: import net.myvietnam.mvncore.MVNCoreConfig;
039: import net.myvietnam.mvncore.service.URLResolverService;
040: import net.myvietnam.mvncore.web.*;
041:
042: public class URLResolverServiceImplServletDefault implements
043: URLResolverService {
044:
045: public boolean isSupportServlet() {
046: return true;
047: }
048:
049: public boolean isSupportPortlet() {
050: return false;
051: }
052:
053: public String encodeURL(HttpServletRequest request,
054: HttpServletResponse response, String url) {
055: if (MVNCoreConfig.getEnableEncodeURL()) {
056: url = response.encodeURL(url);
057: }
058: return url;
059: }
060:
061: public String encodeURL(GenericRequest request,
062: GenericResponse response, String url) {
063: return encodeURL(request.getServletRequest(), response
064: .getServletResponse(), url);
065: }
066:
067: public String encodeURL(HttpServletRequest request,
068: HttpServletResponse response, String url, int option) {
069: if (MVNCoreConfig.getEnableEncodeURL()) {
070: url = response.encodeURL(url);
071: }
072: return url;
073: }
074:
075: public String encodeURL(GenericRequest request,
076: GenericResponse response, String url, int option) {
077: return encodeURL(request.getServletRequest(), response
078: .getServletResponse(), url, option);
079: }
080:
081: public String encodeURL(HttpServletRequest request,
082: HttpServletResponse response, String url, int option,
083: String mode) {
084: // not implemented for cross module links
085: if (MVNCoreConfig.getEnableEncodeURL()) {
086: url = response.encodeURL(url);
087: }
088: return url;
089: }
090:
091: public String encodeURL(GenericRequest request,
092: GenericResponse response, String url, int option,
093: String mode) {
094: return encodeURL(request.getServletRequest(), response
095: .getServletResponse(), url, option, mode);
096: }
097:
098: public String decodeAction(GenericRequest request,
099: GenericResponse response) {
100: return "";
101: }
102:
103: public String generateFormAction(HttpServletRequest request,
104: HttpServletResponse response, String url) {
105: return "";
106: }
107:
108: public String getActionParam() {
109: return "";
110: }
111:
112: }
|