{"id":18907656,"url":"https://github.com/swhors/simpsonsimplewas","last_synced_at":"2026-03-05T23:30:23.720Z","repository":{"id":178525825,"uuid":"376520972","full_name":"swhors/SimpsonSimpleWAS","owner":"swhors","description":"Private Java WAS","archived":false,"fork":false,"pushed_at":"2021-06-13T11:17:49.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-31T11:57:03.034Z","etag":null,"topics":["java","private","was"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swhors.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-13T11:14:17.000Z","updated_at":"2021-06-13T11:18:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"e013cdbb-1ecd-4351-bdd7-e235dddc261c","html_url":"https://github.com/swhors/SimpsonSimpleWAS","commit_stats":null,"previous_names":["swhors/simpsonsimplewas"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swhors%2FSimpsonSimpleWAS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swhors%2FSimpsonSimpleWAS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swhors%2FSimpsonSimpleWAS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swhors%2FSimpsonSimpleWAS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swhors","download_url":"https://codeload.github.com/swhors/SimpsonSimpleWAS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239891272,"owners_count":19714101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","private","was"],"created_at":"2024-11-08T09:22:42.103Z","updated_at":"2026-03-05T23:30:23.673Z","avatar_url":"https://github.com/swhors.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpsonSimpleWAS\n+ Private Java WAS\n## Who\n+ swhors@naver.com\n+ 2021/04/26\n## Introduce\n+ 이 프로젝트는 Native-Java를 사용하여 WAS를 만드는 것 입니다.\n+ 이 SimpsonWeb은 다음과 같은 특성을 갖고 있습니다.\n  1. 일반적인 WAS의 기능을 지원한다. 사용자에게 Java 클래스로 서비스를 \n   지원할 수 있으며, HTML 파일을 읽어서  서비스를 제공할 수도 있다.  \n  2. 접속 URL에 따라서 동작을 달리 할 수 있다. \n   예를 들어서, \"a.com\"으로 요청이 온 경우에는 /a에서 파일을 읽을 수 있다. 그리고,\n   \"b.com\"으로 요청이 온 경우에는 /b에서 파일을 읽고 전송할 수 있으며, 지원되는 서비스도\n   /a와 달리 지정할 수 있다.\n  3. 서블릿의 추가를 환경 설정을 통하여 할 수 있다.\n  4. 기본 제공되는 서비스는 다음과 같다.\n   - localhost : Hello, CurrentTime, controller.Hello, controller.CurrentTime\n   - simpson.com : Hello, controller.Hello\n## 컴파일과 구동\n+ 컴파일은 다음과 같다. \n  1. maven package\n+ 컴파일을 하면 targets 폴더에 다음의 두 개의 파일이 생성된다.\n  1. SimpsonWeb-1.0-SNAPSHOT.jar\n  2. SimpsonWeb-1.0-SNAPSHOT-jar-with-dependencies.jar\n + 처음의 jar 파일은 dependency를 포함하지 않는 것이다. 두 번째의 jar 파일을 이욯하여 구동하여야 한다.\n + 구동은 다음과 같다.\n  1. java -jar targets/SimpsonWeb-1.0-SNAPSHOT-jar-with-dependencies.jar\n## 환경 설정\n+ 프로그램의 환경 설정은 json 형태로 제공 되며, 위치는 다음과 같다.\n  1. src/main/resources/application.json\n+ 환경 설정은 크게 다음의 세개로 나뉘어 진다.\n  1. server : 서버의 정보 설정 (예 : 포트)\n  2. html : html 파일 설정 (예 : error.html)\n  3. policy : 서비스와 관련 된 환경 설정\n   - 이것은 blacklist와 urls 구성 된다.\n+ server는 port 번호를 설정한다.\n  ```\n   \"server\": {\n      \"port\": 8081\n   },\n  ```\n+ html의 예제는 다음과 같다.\n  ```\n  \"html\": {\n      \"errorFiles\": [\n        {\"errorType\":\"400\",\"fileName\":\"/400.html\"}\n      ]\n  }\n  ```\n  지금 현재는 error를 사용자에게 알려 주기 위한 html 파일의 위치만 설정한다.\n+ policy는 다음과 같은 구조로 되어 있다.\n  ```\n  \"policy\": {\n     \"blacklist\":[\"../\", \".exe\"],\n     \"urls\": [ { } ]\n  }\n  ```\n  blacklist는 url-path에 특정 단어가 들어가는 경우, 405 처리를 하기 위한 필터 목록을 설정한다.\n  url은 address에 따라서, 어떤 서비스를 제공할 것인지에 대한 설정을 한다. 아래와 같은 형식으로 되어 있다.\n  ```\n  \"urls\": {\n     \"address\": \"클라이언트가 서비스를 요청한 주소, 예:a.com, localhost ..\",\n     \"rootDir\": \"document가 있는 rootDir\",\n     \"className\": \"이 주소의 요청을 처리할 메인 클래스. 예: LocalhostLoader.class\",\n     \"controllers\": [controllers 의 정보들]\n  }\n  ```\n  controllers는 다음과 같은 정보의 리스트 이다.\n  ```\n  {\n    \"path\": \"서비스 경우. 예: /Hello\",\n    \"className\": \"서비스를 제공하는 콘트롤러 클래스의 이름\"\n  }\n  ```\n  \n+ 다음은 환경 설정의 예이다.\n  ```$xslt\n  {\n    \"server\": {\n      \"port\": 8081\n    },\n    \"html\": {\n      \"errorFiles\": [\n        {\"errorType\":\"400\",\"fileName\":\"/400.html\"},\n        {\"errorType\":\"403\",\"fileName\":\"/403.html\"},\n        {\"errorType\":\"404\",\"fileName\":\"/404.html\"},\n        {\"errorType\":\"500\",\"fileName\":\"/500.html\"}\n      ]\n    },\n    \"policy\": {\n      \"blacklist\":[\"../\", \".exe\"],\n      \"urls\": [\n        {\n          \"address\": \"localhost\",\n          \"rootDir\": \"/localhost\",\n          \"className\": \"com.simpson.domain.url.urlloader.LocalLoader\",\n          \"controllers\": [\n            {\"path\": \"/Hello\", \"className\": \"com.simpson.domain.controller.Hello\"},\n            {\"path\": \"/CurrentTime\", \"className\": \"com.simpson.domain.controller.CurrentTime\"},\n            {\"path\": \"/service.Hello\", \"className\": \"com.simpson.domain.controller.service.Hello\"},\n            {\"path\": \"/service.CurrentTime\", \"className\": \"com.simpson.domain.controller.service.CurrentTime\"}\n          ]\n        },\n        {\n          \"address\": \"simpson.com\",\n          \"rootDir\": \"/simpson_com\",\n          \"className\": \"com.simpson.domain.url.urlloader.SimpsonLoader\",\n          \"controllers\": [\n            {\"path\": \"/Hello\", \"className\": \"com.simpson.domain.controller.Hello\"},\n            {\"path\": \"/service.Hello\", \"className\": \"com.simpson.domain.controller.service.Hello\"}\n          ]\n        }\n      ]\n    }\n  }\n\n  ```\n## 테스트\n+ /Hello\n```$xslt\nPS D:\\work\\SimpsonWeb\u003e curl http://localhost:8081/Hello?name=simpson\n\n\nStatusCode        : 200\nStatusDescription : OK\nContent           : \u003chtml\u003e\n                    \u003chead\u003e\n                    \u003ctitle\u003e\n                    Hello\u003c/title\u003e\n                    \u003c/head\u003e\n                    \u003cbody\u003e\n                    \u003cp\u003eHello, simpson\u003c/p\u003e\n                    \u003c/body\u003e\n                    \u003c/html\u003e\n\nRawContent        : HTTP/1.1 200 OK\n                    Content-Length: 89\n                    Content-Type: text/html;charset=utf-8\n\n                    \u003chtml\u003e\n                    \u003chead\u003e\n                    \u003ctitle\u003e\n                    Hello\u003c/title\u003e\n                    \u003c/head\u003e\n                    \u003cbody\u003e\n                    \u003cp\u003eHello, simpson\u003c/p\u003e\n                    \u003c/body\u003e\n                    \u003c/html\u003e\n\nForms             : {}\nHeaders           : {[Content-Length, 89], [Content-Type, text/html;charset=utf-8]}\nImages            : {}\nInputFields       : {}\nLinks             : {}\nParsedHtml        : System.__ComObject\nRawContentLength  : 89\n\nPS D:\\work\\SimpsonWeb\u003e\n```\n+ CurrentTime\n```$xslt\nPS D:\\work\\SimpsonWeb\u003e curl http://localhost:8081/CurrentTime\n\n\nStatusCode        : 200\nStatusDescription : OK\nContent           : \u003chtml\u003e\n                    \u003chead\u003e\n                    \u003ctitle\u003e\n                    CurrentTime\u003c/title\u003e\n                    \u003c/head\u003e\n                    \u003cbody\u003e\n                    \u003cp\u003eToday is MONDAY.\n                    \u003cbr/\u003e\n                        Current date =\u003e 2021-4-26\n                    \u003cbr/\u003e\n                        Current time =\u003e 1:9:59\n                    \u003c/p\u003e\n                    \u003c/body\u003e\n                    \u003c/html\u003e\n\nRawContent        : HTTP/1.1 200 OK\n                    Content-Length: 161\n                    Content-Type: text/html;charset=utf-8\n\n                    \u003chtml\u003e\n                    \u003chead\u003e\n                    \u003ctitle\u003e\n                    CurrentTime\u003c/title\u003e\n                    \u003c/head\u003e\n                    \u003cbody\u003e\n                    \u003cp\u003eToday is MONDAY.\n                    \u003cbr/\u003e\n                        Current date =\u003e 2021-4-26\n                    \u003cbr/\u003e\n                        Curr...\nForms             : {}\nHeaders           : {[Content-Length, 161], [Content-Type, text/html;charset=utf-8]}\nImages            : {}\nInputFields       : {}\nLinks             : {}\nParsedHtml        : System.__ComObject\nRawContentLength  : 161\n\nPS D:\\work\\SimpsonWeb\u003e\n```\n+ service.Hello\n```$xslt\nPS D:\\work\\SimpsonWeb\u003e curl http://localhost:8081/service.Hello?name=simpson\n\n\nStatusCode        : 200\nStatusDescription : OK\nContent           : \u003chtml\u003e\n                    \u003chead\u003e\n                    \u003ctitle\u003e\n                    Hello\u003c/title\u003e\n                    \u003c/head\u003e\n                    \u003cbody\u003e\n                    \u003cp\u003eHello, simpson\u003c/p\u003e\n                    \u003c/body\u003e\n                    \u003c/html\u003e\n\nRawContent        : HTTP/1.1 200 OK\n                    Content-Length: 89\n                    Content-Type: text/html;charset=utf-8\n\n                    \u003chtml\u003e\n                    \u003chead\u003e\n                    \u003ctitle\u003e\n                    Hello\u003c/title\u003e\n                    \u003c/head\u003e\n                    \u003cbody\u003e\n                    \u003cp\u003eHello, simpson\u003c/p\u003e\n                    \u003c/body\u003e\n                    \u003c/html\u003e\n\nForms             : {}\nHeaders           : {[Content-Length, 89], [Content-Type, text/html;charset=utf-8]}\nImages            : {}\nInputFields       : {}\nLinks             : {}\nParsedHtml        : System.__ComObject\nRawContentLength  : 89\n\nPS D:\\work\\SimpsonWeb\u003e\n```\n\n## Reference\n+ https://github.com/next-step/jwp-was","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswhors%2Fsimpsonsimplewas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswhors%2Fsimpsonsimplewas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswhors%2Fsimpsonsimplewas/lists"}