package com.huettermann.all;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Message extends HttpServlet {

    private static Logger logger = LoggerFactory.getLogger(Message.class);

    @Override
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
            throws ServletException, IOException {

        String param = request.getParameter("param");
        ServletContext context = getServletContext();

        if (param == null || param.equals("")) {
            context.log("No message received:",
                    new IllegalStateException("Missing parameter"));
        } else {
            context.log("Here the paramater: " + param);
        }

        PrintWriter out = null;
        if (request.getRequestedSessionId().equals("4711")) {
            try {
                out = response.getWriter();
                String encodedName = org.owasp.encoder.Encode.forHtml(param);
                out.println("Hello: " + encodedName);
                out.flush();
                out.close();
            } catch (IOException io) {
                logger.info(io.getMessage());
            }
        }
    }
}
@@ -837,74 +837,8 @@
 ll;%0A
-        if (request.getRequestedSessionId().equals(%224711%22)) %7B%0A    
     
@@ -859,20 +859,16 @@
         
-  
-  
 out = re
@@ -883,28 +883,24 @@
 etWriter();%0A
-    
             
@@ -969,28 +969,24 @@
             
-    
 out.println(
@@ -1019,28 +1019,24 @@
             
-   
- 
 out.flush();
@@ -1032,28 +1032,24 @@
 ut.flush();%0A
-    
             
@@ -1069,20 +1069,16 @@
         
-  
-  
 %7D catch 
@@ -1092,28 +1092,24 @@
 ption io) %7B%0A
-    
             
@@ -1142,22 +1142,8 @@
 ));%0A
-            %7D%0A
     

fix the code