This discussion is archived
4 Replies Latest reply: Jun 7, 2012 2:16 AM by gimbal2 RSS

jsp vs xhtml

942052 Newbie
Currently Being Moderated
Hi,

Could any one clearify me what is the difference or benefits between .jsp and .xhtml extension file for JSF.

Thanks in Advance

Arun
  • 1. Re: jsp vs xhtml
    EJP Guru
    Currently Being Moderated
    JSP is not an 'extension for JSF', it is an alternative and older technology.

    JSPs generate Java code and have to be compiled and are now deprecated in favor of Facelets.
  • 2. Re: jsp vs xhtml
    gimbal2 Guru
    Currently Being Moderated
    EJP wrote:
    JSP is not an 'extension for JSF', it is an alternative and older technology.
    Not entirely accurate, JSPs can still be used in conjunction with JSF to handle the view rendering. That is something that JSF itself doesn't really do, although you can argue that JSF 2 does because Facelets is bundled and managed as part of the framework now.
    JSPs generate Java code and have to be compiled and are now deprecated in favor of Facelets.
    That of course is right on the mark. The compiled nature of JSPs does not really work well with the way JSF operates although I must admit I never looked into what JSP 2.0 changed to remedy that. But still Facelets gives you nice features such as templating right out of the box.
  • 3. Re: jsp vs xhtml
    EJP Guru
    Currently Being Moderated
    Not entirely accurate, JSPs can still be used in conjunction with JSF to handle the view rendering.
    Yes it can, but it is still not an 'extension of JSF'. It can coexist with JSF, but not very well, as the phases are different.
  • 4. Re: jsp vs xhtml
    gimbal2 Guru
    Currently Being Moderated
    EJP wrote:
    Not entirely accurate, JSPs can still be used in conjunction with JSF to handle the view rendering.
    Yes it can, but it is still not an 'extension of JSF'. It can coexist with JSF, but not very well, as the phases are different.
    Coexist sounds like a fitting description of the relationship, yes. In that respect I'd say that Facelets is actually not a true "replacement" for JSPs (like I've been calling it until now) but rather a way to complete JSF and get rid of the dependency on that legacy tech.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points