1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.servlet;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.util.Portal;
20  import com.liferay.portal.util.PortalUtil;
21  
22  import java.io.IOException;
23  
24  import javax.servlet.RequestDispatcher;
25  import javax.servlet.ServletContext;
26  import javax.servlet.ServletException;
27  import javax.servlet.http.HttpServlet;
28  import javax.servlet.http.HttpServletRequest;
29  import javax.servlet.http.HttpServletResponse;
30  
31  /**
32   * <a href="SitemapServlet.java.html"><b><i>View Source</i></b></a>
33   *
34   * @author Jorge Ferrer
35   */
36  public class SitemapServlet extends HttpServlet {
37  
38      public void service(
39              HttpServletRequest request, HttpServletResponse response)
40          throws IOException, ServletException {
41  
42          try {
43              String redirect = Portal.PATH_MAIN + "/layout_management/sitemap";
44  
45              ServletContext servletContext = getServletContext();
46  
47              RequestDispatcher requestDispatcher =
48                  servletContext.getRequestDispatcher(redirect);
49  
50              requestDispatcher.forward(request, response);
51          }
52          catch (Exception e) {
53              _log.error(e, e);
54  
55              PortalUtil.sendError(
56                  HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e, request,
57                  response);
58          }
59      }
60  
61      private static Log _log = LogFactoryUtil.getLog(SitemapServlet.class);
62  
63  }