JSF 2 with HTML pages instead of XHTML

后端 未结 2 1605
臣服心动
臣服心动 2020-12-07 03:12

I am trying to get JSF setup to use files with a html extension.

If I use a .xhtml pattern (*.xhtml) and name my

2条回答
  •  时光说笑
    2020-12-07 03:26

    As BalusC said you don't need to change the physical file names.

    But anyway I spotted odd values in your web.xml schema. There are mixed version 2_5 and 3_0 values.

    With the settings below you should be able to keep files with .xhtml extension and access them as .html.

    
    
        
            javax.faces.PROJECT_STAGE
            Development
        
        
            javax.faces.DEFAULT_SUFFIX
            .xhtml
        
        
            Faces Servlet
            javax.faces.webapp.FacesServlet
            1
        
        
            Faces Servlet
            *.html
        
        
            index.html
        
    
    

    I tested it in GlassFish 3.1.2 with Mojarra 2.1.6 and it works fine.

    I hope it helps.

提交回复
热议问题