JSF - xmlns:h not being recognized? [duplicate]

左心房为你撑大大i 提交于 2019-11-28 12:04:50

问题


This question already has an answer here:

  • JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output 1 answer

In the "search" XHTML portion of my project, the "h" tags arent being recognized. I really have no clue why they aren't working. Any insight? Here's a link to the xhtml file hosted on google code so the entire project can be viewed.

https://code.google.com/p/xdsgui/source/browse/trunk/Frontend/WebContent/search.xhtml

Thanks.


回答1:


They are supposed to be parsed by the FacesServlet. If they appear unparsed in the retrieved HTML output, then it simply means that the FacesServlet isn't been invoked at all.

Your project's web.xml shows that it's been mapped on an URL pattern of *.jsf. So if you change the .xhtml extension in the request URL of the page in the browser's address bar to .jsf, then it'll work.

Better is however to just map the FacesServlet on an URL pattern of *.xhtml directly. This way you never need to fiddle with virtual URLs and the endusers will also never be able to see the raw JSF source code when they purposefully changes the .jsf extension to .xhtml in the request URL.



来源:https://stackoverflow.com/questions/11770087/jsf-xmlnsh-not-being-recognized

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!