package hello;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import java.util.Enumeration;

 
import com.twilio.sdk.verbs.TwiMLResponse;
import com.twilio.sdk.verbs.TwiMLException;
import com.twilio.sdk.verbs.Message;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

 
public class GrouperServlet extends HttpServlet {
 
    private static final Logger log = Logger.getLogger(Worker.class.getName());

    public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
        BasicConfigurator.configure();

        String phoneNumber = request.getParameter("From");
        String body = request.getParameter("Body");
        
        //for testing!
        /* 
        Enumeration<String> parameterNames = request.getParameterNames();
    
        while (parameterNames.hasMoreElements()) {
            String paramName = parameterNames.nextElement();
            log.info(paramName);
        }
        */
        
        log.info("body: " + body + " from phone number " + phoneNumber);
        Text text = new Text(phoneNumber, body);
        text.execute();
        response.setContentType("application/xml");
        response.getWriter().print("<Response></Response>");
    }
}
@@ -9,16 +9,44 @@
 hello;%0A%0A
+import java.io.IOException;%0A
 import j
@@ -173,405 +173,60 @@
 se;%0A
-import java.io.IOException;%0A%0Aimport java.util.Enumeration;%0A%0A %0Aimport com.twilio.sdk.verbs.TwiMLResponse;%0Aimport com.twilio.sdk.verbs.TwiMLException;%0Aimport com.twilio.sdk.verbs.Message;%0A%0Aimport org.apache.log4j.BasicConfigurator;%0Aimport org.apache.log4j.Logger;%0A%0A %0Apublic class GrouperServlet extends HttpServlet %7B%0A %0A    private static final Logger log = Logger.getLogger(Worker.class.getName());%0A
+%0A %0Apublic class GrouperServlet extends HttpServlet %7B
 %0A   
@@ -329,48 +329,8 @@
 n %7B%0A
-        BasicConfigurator.configure();%0A%0A
     
@@ -440,379 +440,8 @@
 %22);%0A
-        %0A        //for testing!%0A        /* %0A        Enumeration%3CString%3E parameterNames = request.getParameterNames();%0A    %0A        while (parameterNames.hasMoreElements()) %7B%0A            String paramName = parameterNames.nextElement();%0A            log.info(paramName);%0A        %7D%0A        */%0A        %0A        log.info(%22body: %22 + body + %22 from phone number %22 + phoneNumber);%0A
     

Clean up servlet class