Conflict between Spring MVC and Primefaces

Asked

Viewed 1,035 times

1

I have a problem to integrate Spring MVC with Primefaces. It seems that there is a conflict between them.

You have the configuration in web.xml

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>


<!-- Map these files with JSF -->
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsp</url-pattern>
</servlet-mapping>

faces-config.xml file with Spring

org.springframework.web.jsf.el.Springbeanfaceselsolve

And yet it didn’t work.

I’ve tried to this tutorial and the Spring Web-flow tutorial that talks about Spring-Faces and didn’t work.

The source code broken with the problem lies on Github.

  • Good think you should be talking about Spring and not Sring-MVC because the tutorial you passed does not deal with Spring-MVC, better than posting the code in this case would be you post the output of your application server or Servlet (jboss,Tomcat) and also post your pom.xml so colleagues can help you more accurately. Also post faces-config.xml and applicationContext.xml

2 answers

1

I suggest you start your project from a Maven archetype (as one of the two that enable JSF + Spring from that repository). If you want something even more agile you can also try JSF support from Spring Roo. In both cases Primefaces comes preconfigured for you.

Of course there is no perfect solution and you will have to manually upgrade some libraries in the first case (if you want to work with the latest versions of Spring and Primefaces) and / or learn a little about Spring Roo in the second. But this tedious work of configuration is done for you.

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.