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 {
String script= request.getParameter("script");
if ( script==null ) {
response.sendRedirect( "ScriptGUIServletPick" );
return;
}
if ( !ServletUtil.isWhitelisted(script) ) {
throw new IllegalArgumentException("script must come from whitelisted host, contact " +ServletUtil.getServletContact()
+ " to see if script could be run: "+script );
}
String mode;
if ( request.getParameter("img")!=null ) {
mode= "img";
} else if ( "Print SVG".equals(request.getParameter("printsvg")) ) {
mode= "svg";
} else if ( "Print PDF".equals( request.getParameter("printpdf")) ) {
mode= "pdf";
} else if ( request.getParameter("text")!=null ) {
mode= "text";
} else {
mode= "init";
}
long t0= System.currentTimeMillis();
String key= request.getParameter("key");
if ( key==null ) key="";
logger.log( Level.INFO, "enter ScriptGUIServlet: {0} {1}", new Object[] { mode, key } );
Map params= request.getParameterMap();
Map"+sd.getDescription() +"
"); } } else { out.println(""+sd.getDescription() +"
"); } } out.println(""); out.println("\n"); out.println( " | \n"); out.println( "\n"); out.println( "\n"); out.println("\n" ); out.println( " | \n"); out.println( "
GET
method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP POST
method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}//