tanszek:oktatas:informacios_rendszerek_integralasa:java_http_server
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tanszek:oktatas:informacios_rendszerek_integralasa:java_http_server [2023/03/12 17:43] – knehez | tanszek:oktatas:informacios_rendszerek_integralasa:java_http_server [2024/03/13 07:50] (current) – knehez | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Saját HTTP szerver mintapélda ==== | ==== Saját HTTP szerver mintapélda ==== | ||
| - | Let's create an empty Java project, Then create files called //404.html// and an //index.html// with the following content. Let's note that the error handling is redundant, i.e. the handling of // | + | Készítsünk egy üres Java projektet, hozzunk létre egy 404.html |
| - | + | ||
| - | **Task**: create a generic error handling function to return errors to the client side. | + | |
| + | **Feladat**: | ||
| 404.html tartalma: | 404.html tartalma: | ||
| - | <code html> | + | <sxh html> |
| < | < | ||
| < | < | ||
| Line 14: | Line 13: | ||
| </ | </ | ||
| </ | </ | ||
| - | </code> | + | </sxh> |
| index.html tartalma: | index.html tartalma: | ||
| - | <code html> | + | <sxh html> |
| < | < | ||
| < | < | ||
| Line 24: | Line 23: | ||
| </ | </ | ||
| </ | </ | ||
| - | </code> | + | </sxh> |
| JavaHTTPServer.java tartalma: | JavaHTTPServer.java tartalma: | ||
| - | <code java> | + | <sxh java> |
| import java.io.BufferedOutputStream; | import java.io.BufferedOutputStream; | ||
| import java.io.BufferedReader; | import java.io.BufferedReader; | ||
| Line 183: | Line 182: | ||
| } | } | ||
| - | </code> | + | </sxh> |
| **Feladat**: | **Feladat**: | ||
| - | <code java> | + | <sxh java> |
| out.println(" | out.println(" | ||
| out.println(" | out.println(" | ||
| Line 195: | Line 194: | ||
| out.println(); | out.println(); | ||
| out.flush(); | out.flush(); | ||
| - | </code> | + | </sxh> |
| **Feladat**: | **Feladat**: | ||
tanszek/oktatas/informacios_rendszerek_integralasa/java_http_server.1678643028.txt.gz · Last modified: 2023/03/12 17:43 by knehez
