public class ScriptServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
ScriptType type = getScriptType(req);
try {
Worker worker = type.getWorker().newInstance();
Script script = new Script(getScriptName(req));
script.setArgs(getArgs(req));
script.setSource(getCommand(req));
worker.work(script);