Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 414154

Summary: [JavaScriptLoader] Allow scripts to be loaded from other server
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: tbuschto
Version: 2.2   
Target Milestone: 2.2 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Tim Buschtoens CLA 2013-07-31 11:25:16 EDT
Since JavaScriptLoader.js uses XMLHttpRequests, the javascript files can only be serverd by the RAP server itself (same origin policy). For the same reason the files won't show up in the browser debugger tools unless some tricks are used. 

JavaScriptLoader should simply insert "script" tags with "src" attributes into the documents head. To achieve this, the MessageProcesser has to be able to pause message processing until the given javascript is loaded, as the request is no longer blocking execution.
Comment 1 Tim Buschtoens CLA 2013-07-31 11:39:17 EDT
Fixed in commit b0174a6ca3e3062501d23ec40343c7a6796564ed.

This also renames Server.js to Connection.js, as it is closer to Connection.java.

Another changed detail is also that the head part of the message (specifically the requestCounter) is processed after all other operations (on the client). This is because the requestCounter is used in Connection.js to determine if there is a running request (then it's -1). If the message processing is paused and the request counter was already updated, the client could theoretically already send a new request while the response isn't fully processed.