JSF page rendering error:Faces Context

后端 未结 2 1392
[愿得一人]
[愿得一人] 2021-01-17 05:42

I am getting the below messages when my JSF page gets rendered. The page is rendered correctly however in the Console the message below repeats itself numerous times...

2条回答
  •  清歌不尽
    2021-01-17 06:00

    This error basically means that the request URL (the one which you see in the browser address bar, or the one which is used to include/dispatch the desired page) does not match the url-pattern of the FacesServlet's mapping as definied in the web.xml. You need to let the request URL match it to invoke the FacesServlet.

    So if it is for example the following suffix-pattern (extension mapping):

    *.jsf
    

    then you need to ensure that your request URL matches it, i.e. use http://example.com/context/page.jsf instead of http://example.com/context/page.jsp.

    Or if it is for example the following prefix-pattern (directory mapping):

    /faces/*
    

    then you need to ensure that your request URL look like http://example.com/context/faces/page.jsp instead of http://example.com/context/page.jsp.

    Edit: although I wouldn't use multiple url-patterns for the FacesServlet and just stick to one, but the mapping seems to look fine. After all, the error message thus comes from com.web.util.faces.UtilFacesFuncs. That look like a homegrown utility class. What exactly is that class doing? Isn't it just a bug in that utility class that it for example is trying to access the FacesContext too early or too late in the request?

提交回复
热议问题