Results 1 to 7 of 7

Thread: Spring MVC + Java Server Faces integration

  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jul 2012
    Posts
    3

    Default

    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.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    No... As JSF is an entirely different technology then what the controllers are used for.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Jul 2012
    Posts
    3

    Default

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

    I think project without mvc pattern can not scale.

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  7. #7
    Join Date
    May 2008
    Posts
    53

    Default

    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
  •