1 5 package com.dotmarketing.struts; 6 7 import java.io.IOException ; 8 import javax.servlet.ServletException ; 9 import javax.servlet.http.HttpServletRequest ; 10 import javax.servlet.http.HttpServletResponse ; 11 12 import org.apache.struts.action.ActionMapping; 13 14 import com.dotmarketing.util.Config; 15 16 17 21 public class PortalRequestProcessor extends 22 com.liferay.portal.struts.PortalRequestProcessor { 23 24 protected String processPath(HttpServletRequest req, HttpServletResponse res) 25 throws IOException { 26 String path = null; 27 if (req.getRequestURI().startsWith(Config.getStringProperty("CMS_STRUTS_PATH"))) { 28 path = super.callParentProcessPath(req, res); 29 } else { 30 path = super.processPath(req, res); 31 } 32 return path; 33 } 34 35 protected boolean processRoles( 36 HttpServletRequest req, HttpServletResponse res, 37 ActionMapping mapping) 38 throws IOException , ServletException { 39 40 if (req.getRequestURI().startsWith(Config.getStringProperty("CMS_STRUTS_PATH"))) { 41 return super.callParentProcessRoles(req,res,mapping); 42 } else { 43 return super.processRoles(req,res,mapping); 44 } 45 46 } 47 48 protected void doForward( 49 String uri, HttpServletRequest req, HttpServletResponse res) 50 throws IOException , ServletException { 51 if (req.getRequestURI().startsWith(Config.getStringProperty("CMS_STRUTS_PATH"))) { 52 req.getRequestDispatcher(uri).forward(req,res); 53 } else { 54 super.doForward(uri, req, res); 55 } 56 57 } 58 } | Popular Tags |