User Tools

Site Tools


tanszek:oktatas:iss_t:http_server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tanszek:oktatas:iss_t:http_server [2024/03/04 08:09] kneheztanszek:oktatas:iss_t:http_server [2024/03/04 08:09] (current) knehez
Line 184: Line 184:
 </sxh> </sxh>
  
-**Task**: refactor the code and eliminate duplicate parts. Let's create a separate function to return the general HTTP response::+**Task**: refactor the code and eliminate duplicate parts. Let's create a separate function to return general HTTP response::
  
-<code java>+<sxh java>
 out.println("HTTP/1.1 200 OK"); out.println("HTTP/1.1 200 OK");
 out.println("Server: Java HTTP Server v1.0"); out.println("Server: Java HTTP Server v1.0");
Line 194: Line 194:
 out.println(); // blank line between headers and content, very important ! out.println(); // blank line between headers and content, very important !
 out.flush(); // flush character output stream buffer out.flush(); // flush character output stream buffer
-</code>+</sxh>
  
 **Task**: modify the source code so that it can also return images. To do this, first add <img src="…> to index.html and copy an arbitrary image next to the html-s.. **Task**: modify the source code so that it can also return images. To do this, first add <img src="…> to index.html and copy an arbitrary image next to the html-s..
  
tanszek/oktatas/iss_t/http_server.1709539746.txt.gz · Last modified: 2024/03/04 08:09 by knehez