001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.servlet;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.util.Portal;
020    import com.liferay.portal.util.PortalUtil;
021    
022    import java.io.IOException;
023    
024    import javax.servlet.RequestDispatcher;
025    import javax.servlet.ServletContext;
026    import javax.servlet.ServletException;
027    import javax.servlet.http.HttpServlet;
028    import javax.servlet.http.HttpServletRequest;
029    import javax.servlet.http.HttpServletResponse;
030    
031    /**
032     * @author Jorge Ferrer
033     */
034    public class SitemapServlet extends HttpServlet {
035    
036            public void service(
037                            HttpServletRequest request, HttpServletResponse response)
038                    throws IOException, ServletException {
039    
040                    try {
041                            String redirect = Portal.PATH_MAIN + "/layout_management/sitemap";
042    
043                            ServletContext servletContext = getServletContext();
044    
045                            RequestDispatcher requestDispatcher =
046                                    servletContext.getRequestDispatcher(redirect);
047    
048                            requestDispatcher.forward(request, response);
049                    }
050                    catch (Exception e) {
051                            _log.error(e, e);
052    
053                            PortalUtil.sendError(
054                                    HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e, request,
055                                    response);
056                    }
057            }
058    
059            private static Log _log = LogFactoryUtil.getLog(SitemapServlet.class);
060    
061    }