File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Using JSF in existing application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Using JSF in existing application" Watch "Using JSF in existing application" New topic
Author

Using JSF in existing application

Ravi Mirani
Greenhorn

Joined: Aug 09, 2011
Posts: 19
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

Joined: Mar 30, 2005
Posts: 56
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

    Joined: Aug 09, 2011
    Posts: 19
    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

    Joined: Jun 25, 2001
    Posts: 15641
        
      15

    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.


    Customer surveys are for companies who didn't pay proper attention to begin with.
    Ravi Mirani
    Greenhorn

    Joined: Aug 09, 2011
    Posts: 19
    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

    Joined: Mar 30, 2005
    Posts: 56
    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

    Joined: Jun 25, 2001
    Posts: 15641
        
      15

    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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Using JSF in existing application
     
    Similar Threads
    performance using JSF
    To the Authors: What tools support JSF well?
    Presentation layer
    What Are You Using JSF For: Commerical or Personal
    JPG / TIFF viewer