title: Setting the link to HTML in JSP using Spring MVC
body: <p>I try the tutorial on the <a href="https://www.mkyong.com/spring-mvc/spring-mvc-textbox-example/" rel="nofollow">Spring MVC textbox example</a>. Working well, however I have no idea about handling the name of link.</p>
  
  <p>The only working one is <code>http://localhost:8080/SpringMVC/textbox.html</code> and I don't know how to change the <code>textbox.html</code> part to anything else.</p>
  
  <p>According comments and all the information about I realized it's named according the controlling class. </p>
  
  <blockquote>
    <p>TextBoxController.java -> textbox.html</p>
  </blockquote>
  
  <p>Here is the related code:</p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/mvc-dispatcher-servlet.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p><strong>mvc-dispatcher-servlet.xml</strong></p>
  
  <pre><code>&lt;bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" /&gt;
  
  &lt;bean class="nch.customer.controller.TextBoxController"&gt;
      &lt;property name="formView" value="CustomerForm" /&gt;
      &lt;property name="successView" value="CustomerSuccess" /&gt;
      // Anything to put here?
  
      &lt;property name="validator"&gt;
          &lt;bean class="nch.customer.validator.CustomerValidator" /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>TextBoxController.java</strong></p>
  
  <pre><code>public class TextBoxController extends SimpleFormController {
  
  public TextBoxController() {
      setCommandClass(Customer.class);
      setCommandName("customerForm");
      // Or anything to put here?
  }
  
  @Override
  protected ModelAndView onSubmit (
      HttpServletRequest request, HttpServletResponse response, 
      Object command, BindException errors) throws Exception {
  
      Customer customer = (Customer) command;
      return new ModelAndView("CustomerSuccess","customer",customer);
  }
  </code></pre>
  
  <p>My question is. How to change the link name without changing the name of class? Ex:</p>
  
  <blockquote>
    <p>TextBoxController.java -> txb.html</p>
  </blockquote>