1 25 package org.snipsnap.net; 26 27 import org.snipsnap.config.Configuration; 28 import org.snipsnap.config.ConfigurationProxy; 29 import org.snipsnap.snip.Snip; 30 import org.snipsnap.snip.SnipSpaceFactory; 31 32 import javax.servlet.RequestDispatcher ; 33 import javax.servlet.ServletConfig ; 34 import javax.servlet.ServletException ; 35 import javax.servlet.http.HttpServlet ; 36 import javax.servlet.http.HttpServletRequest ; 37 import javax.servlet.http.HttpServletResponse ; 38 import java.io.IOException ; 39 40 41 49 public class RsdServlet extends HttpServlet { 50 private Configuration config; 51 private String startName; 52 53 public void init(ServletConfig servletConfig) throws ServletException { 54 config = ConfigurationProxy.getInstance(); 55 } 56 57 public void doGet(HttpServletRequest request, HttpServletResponse response) 58 throws IOException , ServletException { 59 60 Snip snip = SnipSpaceFactory.getInstance().getBlog().getSnip(); 61 62 request.setAttribute("snip", snip); 63 request.setAttribute("space", SnipSpaceFactory.getInstance()); 64 request.setAttribute("config", config); 65 66 request.setAttribute("url", config.getUrl("/space")); 67 request.setAttribute("baseurl", config.getUrl()); 68 69 RequestDispatcher dispatcher = request.getRequestDispatcher("/rsd.jsp"); 70 dispatcher.forward(request, response); 71 } 72 } | Popular Tags |