1 25 package org.snipsnap.net; 26 27 import org.snipsnap.config.Configuration; 28 import org.snipsnap.config.ConfigurationProxy; 29 30 import javax.servlet.RequestDispatcher ; 31 import javax.servlet.ServletConfig ; 32 import javax.servlet.ServletException ; 33 import javax.servlet.http.HttpServlet ; 34 import javax.servlet.http.HttpServletRequest ; 35 import javax.servlet.http.HttpServletResponse ; 36 import java.io.IOException ; 37 38 39 45 public class VersionServlet extends HttpServlet { 46 private Configuration config; 47 48 public void init(ServletConfig servletConfig) throws ServletException { 49 config = ConfigurationProxy.getInstance(); 50 } 51 52 public void doGet(HttpServletRequest request, HttpServletResponse response) 53 throws IOException , ServletException { 54 55 request.setAttribute("config", config); 56 57 RequestDispatcher dispatcher = request.getRequestDispatcher("/version.jsp"); 58 dispatcher.forward(request, response); 59 } 60 } | Popular Tags |