title: how to appear output at text area same like chatbot in jsp and oracle
body: <p>I am doing a project regarding chatbot but the project using eclipse not AIML. I do not now how to appear a data that had been save in database oracle. `</p>
  
  <p>ChatServlet</p>
  
  <pre><code>public class ChatServlet extends HttpServlet {
      private static final long serialVersionUID = 1L;
      private static String ChatBot = "/ChatBot.jsp";
      private static String HOME = "/Home.jsp";
      private ChatDAO dao;
  
      /**
       * @see HttpServlet#HttpServlet()
       */
  
       public ChatServlet() {
              super();
              dao = new ChatDAO();
              // TODO Auto-generated constructor stub
       }      
      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
          try {
  
              String forward="";
              String action = request.getParameter("action");
              ChatInfo chat = new ChatInfo(); 
  
              if(action.equalsIgnoreCase("delete"))
              {
                  int USER_ID = Integer.parseInt(request.getParameter("USER_ID"));
                  System.out.println(USER_ID);
                  dao.deleteChat(USER_ID);
                  forward = HOME;
                  request.setAttribute("chats", dao.getAllChatDAO()); 
              }
  
              catch (Throwable theException) { 
  
                  System.out.println(theException);
              }
  
  
      }
  
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
  
          ChatInfo chat = new ChatInfo();
  
          int USER_ID = 1;
          int ANSWER_ID = 1;
  
          chat.setANSWER(request.getParameter("answer"));
          chat.setUSER_ID(USER_ID);
          chat.setANSWER_ID(ANSWER_ID);
  
          chat = dao.add(chat);
  
          USER_ID++;
          ANSWER_ID++;
  
          response.sendRedirect("ChatBot.jsp");
  
      }
  }
  </code></pre>
  
  <p>ChatBot.jsp</p>
  
  <pre><code>&lt;div id = "container" align="left"&gt;
      &lt;%  
          String ques = null;
          String[] OpenA = {"Apa yang membawa anda ke mari?","Apa yang boleh saya bantu?", "Bagaimana saya boleh bantu anda hari ini?"};
          List&lt;String&gt; listO = Arrays.asList(OpenA);
          Collections.shuffle(listO);
          for (String name : listO) {
              ques = name;
          }
          out.println("Dr.Anna : "+ ques);
       %&gt;
      &lt;/div&gt;
  
      &lt;form action='ChatServlet' method="post"&gt;
      &lt;div id = "controls"&gt;
          &lt;textarea name = "answer" placeholder = "Enter your message here..."&gt;&lt;/textarea&gt;
          &lt;button type = "submit" value="submit"&gt;Send&lt;/button&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
    &lt;display-name&gt;chat&lt;/display-name&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
      &lt;description&gt;&lt;/description&gt;
      &lt;display-name&gt;ChatServlet&lt;/display-name&gt;
      &lt;servlet-name&gt;ChatServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;ChatServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;ChatServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/ChatServlet&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>The data that i want to appear is at ChatBot.jsp.</p>