Jul 20th, 2012, 05:02 PM
Spring MVC + Java Server Faces integration
Hi, I am developing project which is middle scale web application.
I am using spring mvc in one project and java server face in the other project.
But, I want to combine both project into one project. Actually I want to control all url mappings and flows with the
spring mvc and I want to use jsf(primeface) for the ui.
My problem is, I dont know how can I combine FacesServlet and Dispatcher servlet.
I dont know is it possible but I think possible solution should be like
Request -> dispatcher servlet ( process request and return modelview ) -> faces servlet ( process tags ) -> view
This is pseudo solution, how can I apply this solution into real code.
Jul 21st, 2012, 04:30 AM
Although you might hack something together that sort of works when you are using JSF there is not much you can do with the DispatcherServlet. What you can do is use Spring and the integration of JSF to retrieve beans from the context and use them in your jsf managed beans.
Jul 21st, 2012, 04:55 AM
Normally, I am using @Controller and similar annotations for developing controller.
In the controller, I able to return jsp page with my models and jsp render its succesfully.
In this architecture, I want to change jsp file to jsf so I can use rich-faces like primeface or richface library.
Is it possible, controller get request, process it and return jsf file for view.
Jul 21st, 2012, 05:17 AM
No... As JSF is an entirely different technology then what the controllers are used for.
Jul 21st, 2012, 05:45 AM
But, how can I use MVC pattern in JSF technology ?
I think project without mvc pattern can not scale.
Jul 21st, 2012, 10:56 AM
I suggest you read on JSF. As stated JSF is quite a different beast as Spring MVC... Also scalability isn't only determined by the use of MVC or not... There are also other patterns which work well to even better (MVP, MVVM etc.) so to simply state without MVC it doesn't scale isn't fair.
Jul 31st, 2012, 06:44 PM
Take a look at https://github.com/philwebb/springfaces/ it might provide the type of integration that you are looking for.
Tags for this Thread