Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 17 java ee 8 required before pushing The push action initiates an asynchronous nonblocking request and when it returns the path and conditional headers are cleared in preparation for the builders reuse You might be wondering how useful it is to use PushBuilder in this way in a real world application and you would be right to question this The example was a little artificial and is for demonstration purposes only A more likely scenario is that your application will use JSF or JSP So lets look at JSF integration and how you might use the Server Push feature with JSP JSF Integration The JSF API takes full advantage of Server Push It has full knowledge of all the resource requirements of the requested web page and is well placed to push resources to the client Listing 3 shows a simple example of a JSF page that relies on three resources Listing 3 h outputStylesheet library css name coffee cup css h outputScript library js name coffee cup js target head h head title JSF 23 Server Push Example title h head h body h form h graphicImage library images name coffee cup jpg h form Especially welcome is Server Pushs seamless integration into the JSF API which makes the adoption of performance enhancing HTTP 2 features possible without any code changes
You must have JavaScript enabled to view digital editions.