Google App Engine does not parse JSF 2.0 tags

后端 未结 3 1556
悲&欢浪女
悲&欢浪女 2021-01-21 15:59

I have a problem with running JSF 2.0 on AppEngine. I have following index.xhtml and if I deploy it and open the page, there is nothing but the Title

相关标签:
3条回答
  • 2021-01-21 16:13

    Check this link for MyFaces and GAE Support. It has some hints about how to setup correctly this environment and if you need more information you can suscribe to MyFaces Users Mailing List. To see a running example using JSF on GAE check this link MyFaces HTML5 Demo

    0 讨论(0)
  • 2021-01-21 16:30

    This can happen if the request URL as you've in the browser address bar does not match the URL pattern of the FacesServlet as definied in web.xml. It's the one responsible for parsing the Facelet file, creating the FacesContext and doing all the JSF works.

    You have mapped the FacesServlet on /faces/*, so that means that you've to include /faces/ after the context path in the request URL to get it to run. I.e.

    http://example.com/contextpath/faces/index.xhtml

    Alternatively, you can also change the URL pattern to

    <url-pattern>*.xhtml</url-pattern>
    

    so that all XHTML (Facelet) files will be parsed by FacesServlet anyway.

    0 讨论(0)
  • 2021-01-21 16:37

    This typically happens if a request is not handled by the Faces Servlet and has is not specifically about GAE.

    What URL did you used to access your page? Since you declared a prefix mapping, you have to insert /faces/ into your URLs, e.g. my.appspot.com/faces/mypage.xhtml.

    I would recommend going for suffix mapping and using .xhtml exclusively:

    <servlet-mapping>
        <servlet-name>facesServlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>      
    </servlet-mapping>
    
    0 讨论(0)
提交回复
热议问题