1
votes

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

1
I think problem will be somewhere in spring config not in jsf. As I said, in spring-boot application it's working ok. - bilak
You need to include your servlet mapping and spring boot configuration in the post, otherwise we won't be able to help you... - Xtreme Biker

1 Answers

0
votes

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;
}