package io.highway.to.urhell.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * 
 * Servlet add in your web.xml
 *
 */
public class H2hellServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/plain");
		PrintWriter out = response.getWriter();
//		out.println(RegistryService.getInstance().executeServiceRegistry());
		out.close();
	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	

}

@@ -30,17 +30,19 @@
 servlet;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -53,32 +53,33 @@
 .io.IOException;
+%0D
 %0Aimport java.io.
@@ -90,17 +90,19 @@
 tWriter;
-%0A
+%0D%0A%0D
 %0Aimport 
@@ -132,16 +132,62 @@
 ception;
+%0D%0Aimport javax.servlet.annotation.WebServlet;%0D
 %0Aimport 
@@ -217,16 +217,17 @@
 Servlet;
+%0D
 %0Aimport 
@@ -264,16 +264,17 @@
 Request;
+%0D
 %0Aimport 
@@ -316,16 +316,21 @@
 nse;
+%0D%0A%0D
 %0A/**
+%0D
 %0A * 
+%0D
 %0A * 
@@ -360,15 +360,72 @@
 .xml
+%0D
 %0A *
+ %0D
 %0A */
+%0D%0A@WebServlet(name = %22H2H%22, urlPatterns = %7B %22/h2h%22 %7D)%0D
 %0Apub
@@ -469,19 +469,24 @@
 ervlet %7B
-%0A%0A%09
+%0D%0A%0D%0A    
 private 
@@ -529,12 +529,16 @@
  1L;
-%0A%09%0A%09
+%0D%0A%0D%0A    
 prot
@@ -573,36 +573,33 @@
 Request request,
-%0A%09%09%09
+ 
 HttpServletRespo
@@ -650,19 +650,26 @@
 eption %7B
-%0A%09%09
+%0D%0A        
 response
@@ -698,19 +698,26 @@
 plain%22);
-%0A%09%09
+%0D%0A        
 PrintWri
@@ -751,13 +751,21 @@
 r();
-%0A//%09%09
+%0D%0A        // 
 out.
@@ -828,19 +828,26 @@
 stry());
-%0A%09%09
+%0D%0A        
 out.clos
@@ -850,22 +850,31 @@
 close();
-%0A%09%7D%0A%0A%09
+%0D%0A    %7D%0D%0A%0D%0A    
 protecte
@@ -918,12 +918,9 @@
 est,
-%0A%09%09%09
+ 
 Http
@@ -961,32 +961,45 @@
 ervletException,
+%0D%0A           
  IOException %7B%0A%09
@@ -1000,11 +1000,18 @@
 on %7B
-%0A%09%09
+%0D%0A        
 doPo
@@ -1036,14 +1036,18 @@
 se);
-%0A%09%7D%0A%0A%09%0A
+%0D%0A    %7D%0D%0A%0D
 %0A%7D
+%0D
 %0A

add servlet3.0 annotation to make our servlet auto registered