Reply To: Spring Boot + JSF 2.2 + PrettyFaces | Failing to get @URLMapping to function.

Splash Forums PrettyFaces Users Spring Boot + JSF 2.2 + PrettyFaces | Failing to get @URLMapping to function. Reply To: Spring Boot + JSF 2.2 + PrettyFaces | Failing to get @URLMapping to function.

#26617

Meister
Participant

Turns out that Spring Boot completely ignores web.xml and web-fragment.xml.

Adding this got PrettyFaces to turn on (and print startup info):

@Configuration
public class PrettyConfig
{
	@Bean
	public FilterRegistrationBean prettyFilter() {
	    FilterRegistrationBean prettyFilter = new FilterRegistrationBean(new RewriteFilter());
	    prettyFilter.setDispatcherTypes(DispatcherType.FORWARD, DispatcherType.REQUEST,
	            DispatcherType.ASYNC, DispatcherType.ERROR);
	    prettyFilter.addUrlPatterns("/*");
	    
	    return prettyFilter;
	}
}

But PrettyFaces is still not hitting @URLMapping mapped functions on my controller. Seems to me that maybe the BASE_PACKAGES parameter isn’t getting processed. Thoughts? In this case I’m trying to configure Spring Boot’s embedded Tomcat server.

I found this: http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

Which seems to imply something like:
server.context-parameters.com.ocpsoft.pretty.BASE_PACKAGES=foundation

Would work to set what web.xml described with the context-param . . . But even with this specified my @URLMapping is still not functioning.

My repository on Github has been updated to match my current state.

  • This reply was modified 7 years, 1 month ago by  Meister.
  • This reply was modified 7 years, 1 month ago by  Meister.
  • This reply was modified 7 years, 1 month ago by  Meister.