Ok I have sent a mail regarding all this to the jcr-314 comments list, I
hope this will trigger a discussion. Regarding our implementation, lets
leave it client side and improve a little bit upon it (which means add
script src= handling on the client, the javascript dynamic loading code
is already in place)! I think
Ganesh is right that a server side treatment would be faster but it
opens a can of worms which might break compatibility and causes too many
headaches!
We always can introduce server side script handling later on once we
know we have to do it, one way or the other (for any reason)
Werner
Werner Punz schrieb:
Ok my personal guess is to move this discussion to the comments list for
the jsf spec, I have not really found anything describing the correct
behavior!
Werner
Werner Punz schrieb:
Pro elements, it is faster because you can ommit client side parsing!
Mojarra probably does nothing currently in this regard!
I am not sure how they are going to handle the embedded scripts case
within a ppr request, because with the standard apis you cannot directly
open an eval from a component!
But I will leave the extension for now, and leave it to the client!
But we need to extend the client script parser to script src=
constructs, we do not cover that yet, we have the functionality in
place to load scripts dynamically but the parser is not fully there
yet as far as I have seen!
However there is one thing we have to implement on the server side, if
an insert or update part is opened on the ppr response writer, and
someone issues an eval also, what do we do, I have to recheck the spec
if something is specified, but I think there was nothing!
Either we can delay the eval until the insert or update is terminated
(what I would prefer, or we have to throw an exception!)
Anyway I personally think this entire area needs more refinement in
jsf 2.1!
Werner
Ganesh schrieb:
Hi,
Let me summarize the arguments against pushing scripts to the eval
section:
1. scripts inside <!-- comments would suddenly become executed if
facelets.SKIP_COMMENTS is false (which is the Facelets default)
2. omitting scripts within the markup may damage the layout
3. script order gets messed up if scripts rendered via startElement
always come last
4. mojarra doesn't do it
No pro arguments in sight, I guess ...
Best regards,
Ganesh
Werner Punz schrieb:
Ganesh schrieb:
Well the corner case is this...
If you are outside of an insert or update cycle the problem is
following: What do you do with a simple issued script tag, you
have to open an <eval> section in this case
What do you want to express with >>outside of an insert or update
cycle<< ?
Following usecase:
Someone writes the ppr response directly instead of going through
the framework.
What do you do in case of startElement("script" then
do you write it out or do you push it into an automated eval section!
My personal guess is, after a second thought, you dont do anything
special, you just should interfere with delayed evals in case an
insert or update is issued and not finished, but I am not 100% sure!