Subversion Repositories general

Rev

Rev 1248 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package ak.photoalbum.webapp;

import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import ak.photoalbum.logic.Logic;

public class InitServlet
  extends GenericServlet
{
  public void init()
    throws ServletException
  {
    try {
      ServletConfig config = getServletConfig();

      String configPath = "WEB-INF/conf/photos.xml";
      if(config.getInitParameter("config") != null)
        configPath = config.getInitParameter("config");
                   
      Logic.getLogic().init(new ServletResourceFactory(getServletContext()), configPath);
    }
    catch(Exception ex) {
      throw new ServletException(ex);
    }
  }

  public void service(ServletRequest req, ServletResponse res)
    throws ServletException, IOException
  {
  }
}