This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Using JSF in existing application

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    Saloon Keeper
    Posts: 24829
    172
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    Posts: 24829
    172
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic