title: How to call the html from the java servlet
body: <p>Here is my code:</p>
  
  <pre><code>           @WebServlet({ "/Response1", "/resp" })
             public class Response1 extends HttpServlet {
             private static final long serialVersionUID = 1L;
  
  /**
   * @see HttpServlet#HttpServlet()
   */
  
   * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
   */
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
       int count=0;
       int Number  =1;
       System.out.println("s val is ==&gt; "+request.getParameter("empidVal"));
       String s1 = request.getParameter("empidVal");
       System.out.println(s1);
       services3 empjiras = new services3();
       try {
           Map&lt;Object, Object&gt; map1 = empjiras.getJiras(s1);
           Object obj3 = map1.get("obj3");
  
           map1.remove("obj3");
           System.out.println(obj3);
           Collection c=map1.values();
              String myvalue="";
              for (Iterator iterator = c.iterator(); iterator.hasNext();) 
              {
                  myvalue = (String) iterator.next();
                  count++;
              }
              System.out.println(count);
              int count1 = count;
  
           if(count!=0)
           {
           Set&lt;Map.Entry&lt;Object,Object&gt;&gt; s2=map1.entrySet();
           PrintWriter out1=response.getWriter();
              out1.println("&lt;html&gt;"+
  
                      "&lt;center&gt;&lt;font size=\"20\"&gt;&lt;body&gt;&lt;h2&gt;JIRA Details&lt;/h2&gt;&lt;/font&gt;"+
                      //"&lt;table border='1'&gt;"+
                      "&lt;table width=\"800\" border ='10'&gt;\r\n" + 
                      "&lt;tr&gt;\r\n" + 
                      "&lt;th&gt;&lt;font size ='+2'&gt;Number&lt;/font&gt;&lt;/th&gt;"+
                      "&lt;th&gt;&lt;font size ='+2'&gt;JiraNumber&lt;/font&gt;&lt;/th&gt;"+
                      "&lt;th&gt;&lt;font size ='+2'&gt;Jira Status&lt;/font&gt;&lt;/th&gt;" + 
                      "&lt;th&gt;&lt;font size = '+2'&gt;EmailId&lt;/font&gt;&lt;/th&gt;\r\n&lt;/center&gt;"+
                      "&lt;button type='ok' value='ok'&gt;OK&lt;/button&gt;" +
              "&lt;button type='cancel' value='cancel'&gt;cancel&lt;/button&gt;");
  
  
           for (Iterator&lt;Map.Entry&lt;Object,Object&gt;&gt; iterator = s2.iterator(); iterator.hasNext();)  {
                  Map.Entry&lt;Object,Object&gt; entry = iterator.next();
                  Object name2 = entry.getKey();
                  Object value2 = entry.getValue();
                  Object email  = obj3;
                  int num       = Number++;
                  PrintWriter out=response.getWriter();
                  out.println(
  
                          "&lt;/tr&gt;\r\n" + 
                          "&lt;tr&gt;\r\n" + 
                          "&lt;tr&gt;\r\n" +
                          "&lt;td height=\"100\"&gt;"+num+"&lt;/td&gt;"+
                          "&lt;td height=\"100\"&gt;"+name2+"&lt;/td&gt;\r\n" +
                          "&lt;td height=\"100\"&gt;"+value2+"&lt;/td&gt;\r\n"+
                          "&lt;td height=\"100\"&gt;"+email+"&lt;/td&gt;\r\n"+
                          "&lt;/tr&gt;\r\n");  
  
           }
      out1.println("&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;");
           }
           else
           {
               PrintWriter out=response.getWriter();
              // out.println("count is :"+count1);
               out.println("&lt;html&gt;&lt;body&gt;&lt;h2&gt;no jira issues in validating release&lt;/h2&gt;&lt;/body&gt;&lt;/html&gt;");
           }
       } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      }
  
   }
  </code></pre>
  
  <p>Here i am embedding the html code in an servlet which I think is not a good practice,actually I am reading the objects from another servlet and then processing it and displaying it in the browser.But is there any way how to separate this html code from the servlet.
  Thanks in advance..</p>