Announcement Announcement Module
Collapse
No announcement yet.
Spring MVC + Java Server Faces integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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.

    Comment


    • #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.

      Comment


      • #4
        No... As JSF is an entirely different technology then what the controllers are used for.

        Comment


        • #5
          But, how can I use MVC pattern in JSF technology ?

          I think project without mvc pattern can not scale.

          Comment


          • #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.

            Comment


            • #7
              Take a look at https://github.com/philwebb/springfaces/ it might provide the type of integration that you are looking for.

              Comment

              Working...
              X