title: Confusion with RequestDispatcher saying the browser address bar does not change
body: <p>All the online references and head first JSP&amp;Servlet book I'm reading state the characteristic of RequestDispatcher and Redirect (i.e. resoponse.sendRedirect() ) like:</p>
  
  <p><strong>"Request Dispatcher" - URL in the browser bar does not change.</strong></p>
  
  <p><strong>"Redirect" - The user sees the new URL in the browser.</strong></p>
  
  <p>But according to my test, for RequestDispatcher, I am seeing the URL changes so I don't understand what they really mean.</p>
  
  <p>With the code below,</p>
  
  <ol>
  <li><p>I'm on <code>http://whatever.com/tmp3.jsp</code> and that's what URL in the browser says.</p></li>
  <li><p>Click on the button to call servlet which in return it forwards the data to server then the server sends response back to the browser, so URL in the browser now says <code>http://whatever.com/register</code></p></li>
  </ol>
  
  <p>So.. URL changed! (from .../tmp3.jsp to .../register)</p>
  
  <p>Can anyone explain to me what they mean by "URL in the browser does not change"?</p>
  
  <p>Example:</p>
  
  <p><strong>(tmp3.jsp)</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
     ${message}
     &lt;!-- click button to send request to servlet --&gt;
     &lt;form method="POST" action="register"&gt;
         &lt;input type="submit" value="click!"&gt;
     &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p><strong>(servlet)</strong></p>
  
  <pre><code>package com.masatosan.tmp;
  
  import java.io.IOException;
  
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  
  public class Tmp extends HttpServlet {
  
  
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          doPost(request, response);
      }
  
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          request.setAttribute("message", "processed!");
  
          String address = "/tmp3.jsp";
          request.getRequestDispatcher(address).forward(request, response);
      }//end doPost()
  
  }//end class
  </code></pre>
  
  <p><strong>(web.xml snippet)</strong> - mapping the servlet and URL</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;test&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.masatosan.tmp.Tmp&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;test&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/register&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>