问题:

Spring 没有配置JSF 的文档 该如何配置spring boot JSF

 

解决:

https://github.com/giant35/springbootjsf

 

有几个关键点: 1. pom.xml 加 jsf-impl & jsf-api & tomcat-embed-jasper &jstl;2. 注册JSF Servlet ;3. 添加faces-config.xml ; 4. 添加 xhtml 页面 ; 5. 添加 Beans

  1. pom 添加JSF

     
  2. 提供 ServletRegistrationBean Bean

     
  3. src/main/webapp/WEB-INF/faces-config.xml

     
  4. src/main/webapp/test2.xhtml

     
  5. src/main/java/***/ HelloController.java

     
  6. App.java

     

 

 

参考:

https://www.beyondjava.net/blog/jsf-2-2-primefaces-5-spring-boot/

https://stackoverflow.com/questions/25479986/spring-boot-with-jsf-could-not-find-backup-for-factory-javax-faces-context-face?noredirect=1

 

发表评论

电子邮件地址不会被公开。