h:outputScript missing target error ----------------------------------- Key: MYFACES-2584 URL: https://issues.apache.org/jira/browse/MYFACES-2584 Project: MyFaces Core Issue Type: Bug Components: JSR-314 Affects Versions: 2.0.0-beta-2 Reporter: Werner Punz Priority: Minor
There is a bug in our workflow regarding the h:outputScript which prevents an error message to be shown if the target is not present although being set. Following behavior, make a html page with normal <head and <body tags, not <h:head, or h:body now set the outputScript target to head, and see that nothing happens no error message nothing. A black box test against mojarra revealed that mojarra places a FacesMessage error in the message displaying that the target could not be found. The problem lies within our own lifecycle here, following happens, we have a component event listener on our outputScript which registers itself als componentResource under the target. Now if head or body renders it gets the resources registered for the target head or body and renders them. But the problem now is, if there is no dedicated h:head or h:body the resources will never get called and hence nohting happens. I personally see two solutions to the problem, one being a head or body check on the outputScript side, but this is inperformant. The better idea probably would be simply to also use event mechanisms on the head and body to save a marker somewhere (request maybe) which then later can be checked on the outputScript component side, and if the corresponding marker to target is not present we simply add an error... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.