/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.autoplot.servlet;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author jbf
*/
public class ScriptGUIServletPick extends HttpServlet {
static final Logger logger= Logger.getLogger("autoplot.servlet.scriptgui");
private static File getLog() {
File scriptLogArea= new File( ServletUtil.getServletHome(), "log" );
if ( !scriptLogArea.exists() ) {
if ( !scriptLogArea.mkdirs() ) {
logger.warning("unable to make log area");
}
}
File scriptLogFile= new File( scriptLogArea, "ScriptGUIServlet.log" );
return scriptLogFile;
}
/**
* Processes requests for both HTTP GET
and POST
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
//String script= request.getParameter("script");
try (PrintWriter out = response.getWriter()) {
out.println("