title: Why does <h:link> change destination extension from .html to .xhtml?
body: <p>I'm using JSF 2.1 and I'm experiencing some problems with the <code>&lt;h:link&gt;</code> tag.  I'm trying to have the link's outcome point from my XHTML file to a plain HTML file. However, when I run my web application, the <code>.html</code> extension in link's generated URL is automatically converted to a <code>.xhtml</code> extension.</p>
  
  <p>Here is my Facelet file:</p>
  
  <pre><code>&lt;h:body&gt;
      &lt;h:form&gt;        
          &lt;h:link value="animation" outcome="#{contentForm.ccAnimationLink}"/&gt;            
      &lt;/h:form&gt;
  &lt;h:body&gt;
  </code></pre>
  
  <p>Here is my contentForm bean:</p>
  
  <pre><code>package my.app.content;
  
  import java.io.Serializable;
  import javax.annotation.PostConstruct;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.ManagedProperty;
  import javax.faces.bean.RequestScoped;
  
  @ManagedBean
  @RequestScoped
  public class ContentForm implements Serializable {
      private static final long serialVersionUID = -8463354828156798513L; 
      private String ccAnimationLink = "";    
  
      @PostConstruct
      public void init() {        
          ccAnimationLink = "/content/cc/CC_animation/story.html";        
      }
  
      public String getCcAnimationLink() {
          return ccAnimationLink;
      }
  
      public void setCcAnimationLink(String ccAnimationLink) {
          this.ccAnimationLink = ccAnimationLink;
      }
  }
  </code></pre>
  
  <p>Now, when I run this application, I get the following error:</p>
  
  <blockquote>
    <p>Unable to find matching navigation case from view ID '/content/modifiedcc.xhtml' for outcome '/content/cc/CC_animation/story.html'</p>
  </blockquote>
  
  <p>I made sure that I had the URL correct, so I created a <code>story.xhtml</code> file in that location as well. With that file there it runs without errors.</p>
  
  <p>If I pull the source for the generated page, I can see that the <code>&lt;h:link&gt;</code> was correctly changed to an "a href" tag, as follows:</p>
  
  <pre><code>&lt;a href="/MyWebApp/content/cc/CC_animation/story.xhtml"&gt;animation&lt;/a&gt;
  </code></pre>
  
  <p>For some reason though the URL changes from <code>story.html</code>, like I have it in my bean, to <code>story.xhtml</code>.</p>
  
  <p>How can I make sure that it stays as story.html and not change it to xhtml? </p>
  
  <p>Here is my <code>web.xml</code> file as well:</p>
  
  <pre><code>  &lt;display-name&gt;MyWebApp&lt;/display-name&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Development&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;jsf/login/login.xhtml&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&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;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.faces&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.xhtml&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I tried adding the following to the <code>web.xml</code>, this didn't make a difference:</p>
  
  <pre><code>  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I'm sure this has a very simple solution which I'm just missing right now.  Help would be highly appreciated.  I hope the question is clear.</p>