Announcement Announcement Module
Collapse
No announcement yet.
Spring based JSF integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring based JSF integration

    Hi, Spring community,

    I really enjoy features of new Spring 3, its MVC simplifications. Also I like the power of JSF.

    There is a good sample of Spring+JSF tandem where Spring serves JSF's backing beans with the help of Webflow.

    In the past of JSF there were ways of using Server Faces tags directly in JSP files, thus JSF becomes the "View" part of MVC and Spring keeps serving Controllers handling routing and mapping of requests.

    Is there currently a way of doing same things with Spring 3 and JSF 2? I already got these two working together through Unified Expression Language, but again this combination is JSF based where Spring is used in Backing Beans. I would like to see fully qualified controllers where I can use Spring mapping and use JSF in the usual JSP way. I realize that conception will affect some JSF functionality.

    Any samples of working code?

    Sorry if that question was discussed before, I used search and all I found was about Spring 2.x.

  • #2
    Okay, I'm replying to myself with good news.

    Spring 3 works with 2.5 code flawlessly and I made Spring controller show a JSF page just like in the sample shown in this thread:

    Spring 2.5 Controller working with JSF 2 - now it also works for Spring 3.

    Thus we have now:

    HomeController.java

    Code:
    @Controller
    @RequestMapping("/home")
    public class HomeController {
    	
        @RequestMapping(method = RequestMethod.GET)
        public String homeAction(ModelMap model) {
    		
    		model.put("message", "This is your project's home");
    		return "home";
        }
    }
    And home.xhtml is a Facelet file made up of JSF tags.
    Last edited by eugenep; Apr 30th, 2010, 07:04 AM. Reason: wrapped code with [CODE]

    Comment

    Working...
    X