Sean Schofield wrote:
moving your web-application from one framework to another though will
always include some handling of _javascript_/html, so I wouldn't weigh
that in too much.
    

I'm not so sure about that.   Maybe you change a few pieces of
_javascript_ (like when switching to Struts maybe you open a window with
foo.do instead of foo.jsp) but you shouldn't have to change huge
portions of it.

The end result of any web application is HTML.  If you switch to
faces, why should you have to rewrite all of your _javascript_?  Why
should it matter to the person who wrote the _javascript_ that you are
now producing your HTML in a new way?
  
The whole point of using something like JSF is that you are moving away from writing direct html code.  In the long run, every single thing on your page should be a JSF component, including the script portions.  I think the <x:script> should be used even if it doesn't do anything other than output a <script> tag.  Switching to faces would definitely require some reworking of your _javascript_ since the whole presentation paradigm has changed.  That is why I prefer option #3 the most since it seems the most flexible and is more component oriented.  It may not seem like the easiest thing because you have to change the way you've been writing your _javascript_, but you've also had to change the way you're writing your entire application.

And it's not exactly rewriting your _javascript_, it's only changing how you get references to the components on the page. 

T





Reply via email to