1

I'm using spring boot with jsf (primefaces). here you can find sample of my application. When I invoke this application using mvn spring-boot:run and access application with jsf or with xhtml everything works ok. But when I deploy this application to tomcat, xhtml page is not rendered properly. I can see page source (xhtml source, not html), but this is not wanted. I want to be able to display the same with .jsf and .xhtml.

Can anybody tell me what am I missing?

Edit:

as I reviewd this issue and it was not helpfull (I also have *.xhtml mapping for faces servlet and as I wrote before, this is working on spring-boot embedded tomcat but not on classic tomcat), I think the problem will be more related to the spring configuration, but I'm not sure what and where to change.

Thanks

Community
  • 1
  • 1
bilak
  • 4,526
  • 3
  • 35
  • 75
  • I think problem will be somewhere in spring config not in jsf. As I said, in spring-boot application it's working ok. – bilak May 11 '15 at 17:07
  • You need to include your servlet mapping and spring boot configuration in the post, otherwise we won't be able to help you... – Aritz May 12 '15 at 14:17

1 Answers1

0

Problem in spring config. Add this to file Application.java:

@Bean
public ViewResolver getViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/view/");
    resolver.setSuffix(".xhtml");
    return resolver;
}
Giang Phan
  • 534
  • 7
  • 15