Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 18 java ee 8 h body html As you can see the JSF web page requires an image a CSS file and a JavaScript file When the page is requested all three resources will be pushed to the client via Server Push before the rendered page is returned This can be clearly seen in Chromes Network tab as shown in Figure 2 The pages resources are pushed during the JSF RenderResponsePhase lifecycle phase For each resource that is identified during this process the ExternalContextImpl encodeResourceURL method is invoked and passed the resource location A new PushBuilder object is created from the HttpServletRequest instance associated with the ExternalContext and the resource is pushed to the client All inline resources are pushed to the client and all such pushes are initiated before the page is rendered to the client If you want to try this the code can be cloned from the GitHub repository JSP Integration So what about JSP Disappointingly JSP has not been updated to benefit from Server Push This is unfortunate considering the number of active web applications still using JSP However Figure 2 JSF inline resource pushed to client
You must have JavaScript enabled to view digital editions.