title: How to set value in text box using servlet
body: <pre><code>  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws     ServletException, IOException {
      // TODO Auto-generated method stub
  
      try {
          PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("/home/ahis/Desktop/outfilename.txt", true)));
          out.println("the text");
          out.close();
      } catch (IOException e) {
  
      }
  </code></pre>
  
  <p>I have the above code for writing text to the file.I need to get this data from file and need to set this value as the content of theTextBox.</p>
  
  <p>I have the following jsp file.</p>
  
  <pre><code>         &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%&gt;
     &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"    "http://www.w3.org    /TR/html4/loose.dtd"&gt;
   &lt;html&gt;
   &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="GET" action='Controller' name="good"&gt;
  &lt;input type="submit" name="submit" value="submit"&gt;
  &lt;input type="text" name="done"&gt; 
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>