December 2019
Intermediate to advanced
314 pages
6h 51m
English
Our JavaScript client is primarily required when it comes to testing our WebSocket example. However, one more enhancement you will find in this project is a Java Servlet that will let you remove any hardcoded links to your backend so that both services can still communicate as we move our example to a different machine or port.
The following Servlet determines server endpoint information from an environment variable named CUSTOMER_SERVICE by using the ws://localhost:8080/customers string:
@WebServlet("/AjaxHandler")public class AjaxHandler extends HttpServlet { public AjaxHandler() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String ...Read now
Unlock full access