001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }