{"action":"created","comment":{"url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/comments/173519350","pull_request_review_id":102730395,"id":173519350,"diff_hunk":"@@ -30,74 +31,273 @@\n /**\n  * The purpose of this class is to bypass the Mojarra/MyFaces encoding of the URL found in the \"src\" attribute of a\n  * &lt;script&gt; element or the \"href\" attribute of a &lt;link&gt; element. For more info, see: <a\n- * href=\"http://issues.liferay.com/browse/FACES-1236\">FACES-1236</a>.\n+ * href=\"http://issues.liferay.com/browse/FACES-1236\">FACES-1236</a> and <a\n+ * href=\"https://github.com/javaserverfaces/mojarra/issues/4345\">MOJARRA #4345</a>. This class also ensures that body\n+ * script resources are loaded in each Ajax request by rendering <code>type=\"text/javascript\"</code> as the last\n+ * attribute. For more info, see: <a href=\"https://issues.liferay.com/browse/FACES-3252\">FACES-3252</a> and <a\n+ * href=\"https://github.com/javaserverfaces/mojarra/issues/4340\">MOJARRA #4340</a>.\n  *\n  * @author  Neil Griffin\n  */\n public class ResponseWriterResourceImpl extends ResponseWriterWrapper {\n \n-\t// Private Constants\n-\tprivate static final String REGEX_AMPERSAND = \"[&]amp;\";\n+\t// Private Final Data Members\n+\tprivate final FacesURLEncoder facesURLEncoder;\n+\tprivate final ResponseWriter wrappedResponseWriter;\n \n \t// Private Data Members\n-\tFacesURLEncoder facesURLEncoder;\n-\tprivate ResponseWriter wrappedResponseWriter;\n+\tprivate Attribute javaScriptType;\n+\tprivate boolean writingLink;\n+\tprivate boolean writingScript;\n \n \tpublic ResponseWriterResourceImpl(FacesContext facesContext, ResponseWriter responseWriter) {\n \t\tExternalContext externalContext = facesContext.getExternalContext();\n \t\tthis.facesURLEncoder = FacesURLEncoderFactory.getFacesURLEncoderInstance(externalContext);\n \t\tthis.wrappedResponseWriter = responseWriter;\n \t}\n \n+\t@Override\n+\tpublic Writer append(char c) throws IOException {\n+\n+\t\twriteTypeTextJavaScriptIfNecessary();","path":"bridge-impl/src/main/java/com/liferay/faces/bridge/renderkit/html_basic/internal/ResponseWriterResourceImpl.java","position":52,"original_position":52,"commit_id":"9127a6536fd4cd880fb4e87eba6dc81d3abff04d","original_commit_id":"9127a6536fd4cd880fb4e87eba6dc81d3abff04d","user":{"login":"ngriffin7a","id":989387,"avatar_url":"https://avatars2.githubusercontent.com/u/989387?v=4","gravatar_id":"","url":"https://api.github.com/users/ngriffin7a","html_url":"https://github.com/ngriffin7a","followers_url":"https://api.github.com/users/ngriffin7a/followers","following_url":"https://api.github.com/users/ngriffin7a/following{/other_user}","gists_url":"https://api.github.com/users/ngriffin7a/gists{/gist_id}","starred_url":"https://api.github.com/users/ngriffin7a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngriffin7a/subscriptions","organizations_url":"https://api.github.com/users/ngriffin7a/orgs","repos_url":"https://api.github.com/users/ngriffin7a/repos","events_url":"https://api.github.com/users/ngriffin7a/events{/privacy}","received_events_url":"https://api.github.com/users/ngriffin7a/received_events","type":"User","site_admin":false},"body":"@stiemannkj1 Never-mind, I think I get it. Methods like `append` and `write` are writing in the <script>inside-of-the-script-element</script> so that makes sense.","created_at":"2018-03-09T17:46:51Z","updated_at":"2018-03-09T17:46:51Z","html_url":"https://github.com/liferay/liferay-faces-bridge-impl/pull/338#discussion_r173519350","pull_request_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/comments/173519350"},"html":{"href":"https://github.com/liferay/liferay-faces-bridge-impl/pull/338#discussion_r173519350"},"pull_request":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338"}},"in_reply_to_id":173517017},"pull_request":{"url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338","id":173842018,"html_url":"https://github.com/liferay/liferay-faces-bridge-impl/pull/338","diff_url":"https://github.com/liferay/liferay-faces-bridge-impl/pull/338.diff","patch_url":"https://github.com/liferay/liferay-faces-bridge-impl/pull/338.patch","issue_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues/338","number":338,"state":"open","locked":false,"title":"FACES-3252 Work around Mojarra 4340","user":{"login":"stiemannkj1","id":3483874,"avatar_url":"https://avatars0.githubusercontent.com/u/3483874?v=4","gravatar_id":"","url":"https://api.github.com/users/stiemannkj1","html_url":"https://github.com/stiemannkj1","followers_url":"https://api.github.com/users/stiemannkj1/followers","following_url":"https://api.github.com/users/stiemannkj1/following{/other_user}","gists_url":"https://api.github.com/users/stiemannkj1/gists{/gist_id}","starred_url":"https://api.github.com/users/stiemannkj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stiemannkj1/subscriptions","organizations_url":"https://api.github.com/users/stiemannkj1/orgs","repos_url":"https://api.github.com/users/stiemannkj1/repos","events_url":"https://api.github.com/users/stiemannkj1/events{/privacy}","received_events_url":"https://api.github.com/users/stiemannkj1/received_events","type":"User","site_admin":false},"body":null,"created_at":"2018-03-08T20:29:41Z","updated_at":"2018-03-09T17:46:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab491bca6b84f034627e342df96c8c214ee88946","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338/commits","review_comments_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338/comments","review_comment_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues/338/comments","statuses_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/statuses/9127a6536fd4cd880fb4e87eba6dc81d3abff04d","head":{"label":"stiemannkj1:workaround-mojarra-4340-FACES-3252","ref":"workaround-mojarra-4340-FACES-3252","sha":"9127a6536fd4cd880fb4e87eba6dc81d3abff04d","user":{"login":"stiemannkj1","id":3483874,"avatar_url":"https://avatars0.githubusercontent.com/u/3483874?v=4","gravatar_id":"","url":"https://api.github.com/users/stiemannkj1","html_url":"https://github.com/stiemannkj1","followers_url":"https://api.github.com/users/stiemannkj1/followers","following_url":"https://api.github.com/users/stiemannkj1/following{/other_user}","gists_url":"https://api.github.com/users/stiemannkj1/gists{/gist_id}","starred_url":"https://api.github.com/users/stiemannkj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stiemannkj1/subscriptions","organizations_url":"https://api.github.com/users/stiemannkj1/orgs","repos_url":"https://api.github.com/users/stiemannkj1/repos","events_url":"https://api.github.com/users/stiemannkj1/events{/privacy}","received_events_url":"https://api.github.com/users/stiemannkj1/received_events","type":"User","site_admin":false},"repo":{"id":42179537,"name":"liferay-faces-bridge-impl","full_name":"stiemannkj1/liferay-faces-bridge-impl","owner":{"login":"stiemannkj1","id":3483874,"avatar_url":"https://avatars0.githubusercontent.com/u/3483874?v=4","gravatar_id":"","url":"https://api.github.com/users/stiemannkj1","html_url":"https://github.com/stiemannkj1","followers_url":"https://api.github.com/users/stiemannkj1/followers","following_url":"https://api.github.com/users/stiemannkj1/following{/other_user}","gists_url":"https://api.github.com/users/stiemannkj1/gists{/gist_id}","starred_url":"https://api.github.com/users/stiemannkj1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stiemannkj1/subscriptions","organizations_url":"https://api.github.com/users/stiemannkj1/orgs","repos_url":"https://api.github.com/users/stiemannkj1/repos","events_url":"https://api.github.com/users/stiemannkj1/events{/privacy}","received_events_url":"https://api.github.com/users/stiemannkj1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stiemannkj1/liferay-faces-bridge-impl","description":null,"fork":true,"url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl","forks_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/forks","keys_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/teams","hooks_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/hooks","issue_events_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/issues/events{/number}","events_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/events","assignees_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/assignees{/user}","branches_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/branches{/branch}","tags_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/tags","blobs_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/git/refs{/sha}","trees_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/statuses/{sha}","languages_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/languages","stargazers_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/stargazers","contributors_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/contributors","subscribers_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/subscribers","subscription_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/subscription","commits_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/commits{/sha}","git_commits_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/git/commits{/sha}","comments_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/comments{/number}","issue_comment_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/issues/comments{/number}","contents_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/contents/{+path}","compare_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/merges","archive_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/downloads","issues_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/issues{/number}","pulls_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/pulls{/number}","milestones_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/milestones{/number}","notifications_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/labels{/name}","releases_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/releases{/id}","deployments_url":"https://api.github.com/repos/stiemannkj1/liferay-faces-bridge-impl/deployments","created_at":"2015-09-09T13:19:19Z","updated_at":"2016-01-21T22:26:36Z","pushed_at":"2018-03-08T20:29:29Z","git_url":"git://github.com/stiemannkj1/liferay-faces-bridge-impl.git","ssh_url":"git@github.com:stiemannkj1/liferay-faces-bridge-impl.git","clone_url":"https://github.com/stiemannkj1/liferay-faces-bridge-impl.git","svn_url":"https://github.com/stiemannkj1/liferay-faces-bridge-impl","homepage":null,"size":7580,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"liferay:master","ref":"master","sha":"244b4970f0f5e0b84aea0742f65883c5aa7fef29","user":{"login":"liferay","id":131436,"avatar_url":"https://avatars3.githubusercontent.com/u/131436?v=4","gravatar_id":"","url":"https://api.github.com/users/liferay","html_url":"https://github.com/liferay","followers_url":"https://api.github.com/users/liferay/followers","following_url":"https://api.github.com/users/liferay/following{/other_user}","gists_url":"https://api.github.com/users/liferay/gists{/gist_id}","starred_url":"https://api.github.com/users/liferay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liferay/subscriptions","organizations_url":"https://api.github.com/users/liferay/orgs","repos_url":"https://api.github.com/users/liferay/repos","events_url":"https://api.github.com/users/liferay/events{/privacy}","received_events_url":"https://api.github.com/users/liferay/received_events","type":"Organization","site_admin":false},"repo":{"id":41921616,"name":"liferay-faces-bridge-impl","full_name":"liferay/liferay-faces-bridge-impl","owner":{"login":"liferay","id":131436,"avatar_url":"https://avatars3.githubusercontent.com/u/131436?v=4","gravatar_id":"","url":"https://api.github.com/users/liferay","html_url":"https://github.com/liferay","followers_url":"https://api.github.com/users/liferay/followers","following_url":"https://api.github.com/users/liferay/following{/other_user}","gists_url":"https://api.github.com/users/liferay/gists{/gist_id}","starred_url":"https://api.github.com/users/liferay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liferay/subscriptions","organizations_url":"https://api.github.com/users/liferay/orgs","repos_url":"https://api.github.com/users/liferay/repos","events_url":"https://api.github.com/users/liferay/events{/privacy}","received_events_url":"https://api.github.com/users/liferay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/liferay/liferay-faces-bridge-impl","description":null,"fork":false,"url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl","forks_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/forks","keys_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/teams","hooks_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/hooks","issue_events_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues/events{/number}","events_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/events","assignees_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/assignees{/user}","branches_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/branches{/branch}","tags_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/tags","blobs_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/git/refs{/sha}","trees_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/statuses/{sha}","languages_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/languages","stargazers_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/stargazers","contributors_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/contributors","subscribers_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/subscribers","subscription_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/subscription","commits_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/commits{/sha}","git_commits_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/git/commits{/sha}","comments_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/comments{/number}","issue_comment_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues/comments{/number}","contents_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/contents/{+path}","compare_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/merges","archive_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/downloads","issues_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues{/number}","pulls_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls{/number}","milestones_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/milestones{/number}","notifications_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/labels{/name}","releases_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/releases{/id}","deployments_url":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/deployments","created_at":"2015-09-04T14:55:24Z","updated_at":"2017-03-15T15:10:59Z","pushed_at":"2018-03-09T16:45:30Z","git_url":"git://github.com/liferay/liferay-faces-bridge-impl.git","ssh_url":"git@github.com:liferay/liferay-faces-bridge-impl.git","clone_url":"https://github.com/liferay/liferay-faces-bridge-impl.git","svn_url":"https://github.com/liferay/liferay-faces-bridge-impl","homepage":null,"size":7311,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":32,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338"},"html":{"href":"https://github.com/liferay/liferay-faces-bridge-impl/pull/338"},"issue":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues/338"},"comments":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/issues/338/comments"},"review_comments":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338/comments"},"review_comment":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/pulls/338/commits"},"statuses":{"href":"https://api.github.com/repos/liferay/liferay-faces-bridge-impl/statuses/9127a6536fd4cd880fb4e87eba6dc81d3abff04d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ngriffin7a"}}