tanszek:oktatas:iss_t:http_server
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tanszek:oktatas:iss_t:http_server [2023/03/12 17:51] – knehez | tanszek:oktatas:iss_t:http_server [2024/03/04 08:09] (current) – knehez | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Saját | + | ==== 'My own HTTP' server sample |
Let's create an empty Java project, Then create files called // | Let's create an empty Java project, Then create files called // | ||
Line 7: | Line 7: | ||
Content of // | Content of // | ||
- | <code html> | + | <sxh html> |
< | < | ||
< | < | ||
Line 13: | Line 13: | ||
</ | </ | ||
</ | </ | ||
- | </code> | + | </sxh> |
Content of // | Content of // | ||
- | <code html> | + | <sxh html> |
< | < | ||
< | < | ||
Line 23: | Line 23: | ||
</ | </ | ||
</ | </ | ||
- | </code> | + | </sxh> |
Content of // | Content of // | ||
- | <code java> | + | <sxh java> |
import java.io.BufferedOutputStream; | import java.io.BufferedOutputStream; | ||
import java.io.BufferedReader; | import java.io.BufferedReader; | ||
Line 182: | Line 182: | ||
} | } | ||
- | </code> | + | </sxh> |
- | **Task**: refactor the code and eliminate duplicate parts. Let's create a separate function to return | + | **Task**: refactor the code and eliminate duplicate parts. Let's create a separate function to return |
- | <code java> | + | <sxh java> |
out.println(" | out.println(" | ||
out.println(" | out.println(" | ||
Line 194: | Line 194: | ||
out.println(); | out.println(); | ||
out.flush(); | out.flush(); | ||
- | </code> | + | </sxh> |
**Task**: modify the source code so that it can also return images. To do this, first add <img src=" | **Task**: modify the source code so that it can also return images. To do this, first add <img src=" | ||
tanszek/oktatas/iss_t/http_server.1678643470.txt.gz · Last modified: 2023/03/12 17:51 by knehez