package com.vistech.net;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.awt.event.*;
import java.awt.*;
import java.awt.image.*;
import java.util.*;

public class ImageManipInvokerServlet extends HttpServlet{
   protected String imageBaseDir = ".";
  
   public void init( ServletConfig config )throws ServletException {
      super.init(config);

      try {
         String baseDir = getInitParameter("imageBaseDir");
         if(baseDir != null) imageBaseDir = baseDir;
      } catch (Exception e){
           throw new ServletException( e.toString() );
      } 
   }

   public void doGet(HttpServletRequest req, HttpServletResponse res)
                  throws ServletException{
      try {
         req.setAttribute("imageDir", imageBaseDir);
         ServletContext sc =  getServletContext();
         RequestDispatcher rd = sc.getRequestDispatcher("/jsp/imageviewer/ImageLoadAndManip.jsp");
         rd.forward(req, res);
      } catch(Exception e) {}

   }

   public void doPost(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException {
        doGet(request, response);
   }
}
