• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JSF in existing application

 
Ravi Mirani
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using an application in which we have our own frontcontroller and all the request are navigated through that. We want to use JSF in existing application.
How to add JSF framework functionality in an existing application.
 
Ajeeth Kumar
Ranch Hand
Posts: 56
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its is not an easy walk to switch from existing architecture to JSF.

  • First you would have to get all the presentation logic moved to JSF (backing beans & jsp/xhtml)
  • Remove your web.xml entries that point to the frontcontroller and create the faces-config.xml file with all the navigation rules.
  • Add the servlet mapping entries to move all the controls to the Faces servlet.


  •  
    Ravi Mirani
    Greenhorn
    Posts: 19
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for your reply.

    We have around 1000 screens, and its not possible to move all the views to JSF, as this requires huge effort and involves high risk.

    Is there a way where we can develop new functionality using the JSF without affecting existing source code and later if time permits we can migrate our existing code.
     
    Tim Holloway
    Saloon Keeper
    Pie
    Posts: 17616
    39
    Android Eclipse IDE Linux
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Welcome to the JavaRanch, Ravi!

    Yes, JSF allows for gradual migration. It plays very nicely with alternate technologies such as serlvets, JSPs, Struts, and pretty much any framework that isn't dependent on "owning" the application from start to finish. Just replace the original pages and logic as time and budget permit. I have a project like that myself.

    Two things make a gradual migration easier.

    1. Most of the JSF scope objects are the exact same scope objects as in regular JSP. So things like session and application scope beans can be freely shared between the legacy code and the JSF code. JSF2 supersets these object scopes, but doesn't remove any of the traditional J2EE scopes.

    2. JSF, done properly, is almost all POJOs and view templates. So if you can extract your legacy logic into POJO form, it's fairly easy to migrate. And well-designed apps usually isolate the display logic from the business logic anyway.
     
    Ravi Mirani
    Greenhorn
    Posts: 19
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for your reply.

    Which implementation of JSF you think is better?
    Our application code is compatible with jdk 1.4.
    Are there any JSF implementations which support jdk 1.4? Does mojarra provide jar files support jdk 1.4?
     
    Ajeeth Kumar
    Ranch Hand
    Posts: 56
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Ravi Mirani wrote:Thanks for your reply.

    We have around 1000 screens, and its not possible to move all the views to JSF, as this requires huge effort and involves high risk.

    Is there a way where we can develop new functionality using the JSF without affecting existing source code and later if time permits we can migrate our existing code.


    You can sepcify the path of the pages that should get the control from JSF just like how you would do a normal servlet mapping. This way, you can slowly migrate.
     
    Tim Holloway
    Saloon Keeper
    Pie
    Posts: 17616
    39
    Android Eclipse IDE Linux
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I can't remember any more, but I'm not sure if JSF ever worked under 1.4. In any event, 1.4 has passed End of Life. So you need to validate your existing code for 1.6 if you ever hope to get vendor support from Oracle.

    Fortunately, unlike certain other platforms, Java goes to great efforts to ensure that legacy code will continue to run with little or no change.
     
    Consider Paul's rocket mass heater.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic