labs / tiddlers / content / labs / lab04 / _Labs_04_Examining

Let's take a look at the HTTP messages that are being sent between the web browser and web server.

  1. Run the following command from a terminal (note that this only works in the Linux desktop):

     tcpflow port 8080

    This will run a network monitor that will show you everything that is happening between the browser and web server. Note that this network monitor will only allow you to monitor local (loopback) connections --- ITS security would get very rumpy if we let you monitor data that was travelling on the real network.

    Requests are coloured in blue, and responses are red. However, sometimes the colour coding gets a bit broken and everything is red. You should be able to identify requests and responses based on what you saw in lecture 6.

  2. Add a student via the form. You should see the POST request being sent to the server. You will need to scroll up a bit since the most recent requests will be the redirect (the 302 Found response is the redirect), and the GET request for the view-students.jsp. You are looking for the POST to /lab04/add-student

    Note the format Content-Type header, and the of the body payload.

  3. Find the GET request for view-students.jsp. You should see a GET request being sent to the server and the server sending back the HTML to the browser. Note that the HTML already has the student data --- there is no Java code being sent to the browser. SSR means that the server has done all of the hard work of adding the dynamic content, so all that the browser sees is the final HTML.

    You will probaly also see the CSS being requested and returned, since the HTML for the page has a link to the CSS, so the browser needs to also request the CSS.