-
Jul 20th, 2012, 05:02 PM
#1
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.
Thanks
-
Jul 21st, 2012, 04:30 AM
#2
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
#3
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
#4
No... As JSF is an entirely different technology then what the controllers are used for.
-
Jul 21st, 2012, 05:45 AM
#5
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
#6
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
#7
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules