Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f4a34a9
feat: servlet jsp 기본 예시 구현
lyouxsun Oct 7, 2024
33f5315
feat: jsp로 변경, HomeController 추가
lyouxsun Oct 7, 2024
bb5d666
feat: 개인정보 수정
lyouxsun Oct 7, 2024
c87f576
feat: 로그인, 로그아웃 구현
lyouxsun Oct 7, 2024
662a3b3
feat: 회원 목록 보안 강화 구현
lyouxsun Oct 7, 2024
2906265
feat: 개인정보 수정 보안 강화 구현
lyouxsun Oct 7, 2024
f200d11
feat: mvc 프레임워크 구현
lyouxsun Oct 7, 2024
6471c34
fix: 한글 인코딩 오류 수정
lyouxsun Oct 12, 2024
71712f9
fix: requestMapping으로 선언
lyouxsun Oct 12, 2024
37c008a
feat: 순수 jdbc로 userDao 클래스 구현
lyouxsun Oct 24, 2024
3f23dbe
refactor: jdbcTemplate 구현
lyouxsun Oct 24, 2024
0f60e28
refactor: try-with-resource, generic 적용
lyouxsun Oct 24, 2024
7fe01ab
refactor(controller): MemoryUserRepository에서 UserDao로 변경
lyouxsun Oct 28, 2024
a5f5cd2
refactor(db): 미사용 MemoryUserRepository 제거
lyouxsun Oct 28, 2024
0f567e6
feat(Question): Question 엔티티 생성
lyouxsun Oct 28, 2024
b99d53f
feat(QuestionDao): QuestionDao 구현
lyouxsun Oct 28, 2024
6bdf143
feat: 홈화면에서 질문 목록 조회
lyouxsun Oct 28, 2024
6da08b6
feat: 회원만 질문 가능하도록 구현
lyouxsun Oct 28, 2024
e92d397
feat: 질문 생성 및 저장 구현
lyouxsun Oct 28, 2024
a6fd9c7
feat(ShowQuestionController): 질문 조회 기능 구현
lyouxsun Oct 29, 2024
920d11d
feat(UpdateQuestionController): 질문 수정 기능 구현
lyouxsun Oct 29, 2024
07c35e6
refactor: migration from jdbc to Spring
TakioN Nov 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .run/WebServerLauncher.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="jwp.WebServerLauncher" type="Application" factoryName="Application" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="jwp.WebServerLauncher" />
<module name="java-webMVC.main" />
<option name="VM_PARAMETERS" value="-Dfile.encoding=UTF-8" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
58 changes: 28 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
// gradle

plugins {
id 'org.springframework.boot' version '2.7.17' // 스프링 부트 플러그인 적용
id 'io.spring.dependency-management' version '1.0.15.RELEASE' // 의존성 관리 플러그인
id 'java'
id 'idea'
}

idea {
module {
inheritOutputDirs = false
outputDir = file('./webapp/WEB-INF/classes')
}
}

group 'org.example'
version '1.0-SNAPSHOT'
group = 'org.example'
version = '1.0-SNAPSHOT'
sourceCompatibility = '17'
//java {
// sourceCompatibility = '17'
//}

repositories {
mavenCentral()
}

ext {
springVersion = "5.1.8.RELEASE"
tomcatVersion = '8.5.42'
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testImplementation "org.springframework:spring-test:$springVersion"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
// 1. Spring Boot Web Starter
implementation 'org.springframework.boot:spring-boot-starter-web'

// 2. Spring Boot Data JPA Starter
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

implementation("org.springframework:spring-jdbc:$springVersion")
implementation("org.springframework:spring-web:$springVersion")
implementation "org.reflections:reflections:0.10.2"
// 3. JSP 템플릿 엔진 사용을 위한 의존성
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
implementation 'javax.servlet:jstl:1.2'

implementation("org.apache.commons:commons-dbcp2:2.6.0")
// 4. 데이터베이스 드라이버 (H2, MySQL 등 필요한 것 사용)
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'

runtimeOnly("com.h2database:h2:2.1.214")
runtimeOnly('mysql:mysql-connector-java:8.0.28')
// 5. Lombok (선택 사항이지만 강력히 추천)
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

implementation("org.apache.tomcat.embed:tomcat-embed-core:$tomcatVersion")
implementation("org.apache.tomcat.embed:tomcat-embed-logging-juli:8.5.2")
implementation("org.apache.tomcat.embed:tomcat-embed-jasper:$tomcatVersion")
implementation group: 'javax.servlet', name: 'jstl', version: '1.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.7.1'
// 6. Spring Boot Test Starter
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
useJUnitPlatform()
}
}

797 changes: 797 additions & 0 deletions java-webMVC.ipr

Large diffs are not rendered by default.

182 changes: 182 additions & 0 deletions java-webMVC.iws
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="930be402-38f2-457f-a7c9-03283f791020" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/jwp/controller/QnaController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/jwp/controller/UserController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.run/WebServerLauncher.run.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.run/WebServerLauncher.run.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/WebServerLauncher.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/WebServerLauncher.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/jdbc/ConnectionManager.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/jdbc/JdbcTemplate.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/jdbc/KeyHolder.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/jdbc/PreparedStatementSetter.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/jdbc/RowMapper.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/mvc/Controller.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/mvc/DispatcherServlet.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/mvc/ForwardController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/core/mvc/RequestMapping.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/mvc/RequestMapping.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/CreateQuestionController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/CreateQuestionFormController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/CreateUserController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/HomeController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/controller/HomeController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/ListUserController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/LoginController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/LogoutController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/ShowQuestionController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/UpdateQuestionController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/UpdateQuestionFormController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/UpdateUserController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/controller/UpdateUserFormController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/dao/QuestionDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/dao/QuestionDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/dao/UserDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/dao/UserDao.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/model/Question.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/model/Question.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/model/User.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/model/User.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/jwp/support/context/ContextLoaderListener.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/jwp/support/context/ContextLoaderListener.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/WEB-INF/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/.gitignore" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/css/styles.css" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/css/styles.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/css/styles2.css" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/css/styles2.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/favicon.ico" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/favicon.ico" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/home.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/home.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/img/KUIT.png" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/img/KUIT.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/img/picture.jpeg" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/img/picture.jpeg" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/include/header.jspf" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/include/header.jspf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/include/navigation.jspf" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/include/navigation.jspf" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/js/scripts.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/js/scripts.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/qna/form.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/qna/form.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/qna/show.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/qna/show.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/qna/updateForm.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/qna/updateForm.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/user/form.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/user/form.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/user/list.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/user/list.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/user/login.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/user/login.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/user/loginFailed.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/user/loginFailed.jsp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/webapp/user/updateForm.jsp" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/webapp/user/updateForm.jsp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<task path="$PROJECT_DIR$">
<activation />
</task>
<projects_view>
<tree_state>
<expand>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="java-webMVC" type="f1a62948:ProjectNode" />
</path>
</expand>
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 4
}</component>
<component name="ProjectId" id="34xhDacPbTclXrvEjanYtAd64Qr" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Application.WebServerLauncher.executor": "Run",
"Gradle.KUIT6_Server-webMVC [:WebServerLauncher.main()].executor": "Run",
"ModuleVcsDetector.initialDetectionPerformed": "true",
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
"RunOnceActivity.git.unshallow": "true",
"Spring Boot.WebServerLauncher.executor": "Run",
"git-widget-placeholder": "jb-week6",
"kotlin-language-version-configured": "true",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "Project",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"settings.editor.selected.configurable": "reference.projectsettings.compiler.annotationProcessors",
"vue.rearranger.settings.migration": "true"
}
}]]></component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\Users\jungb\Desktop\KUIT6_Server-webMVC\src\main" />
</key>
</component>
<component name="RunManager" selected="Spring Boot.WebServerLauncher">
<configuration name="WebServerLauncher" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
<module name="java-webMVC.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="jwp.WebServerLauncher" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="jwp.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Spring Boot.WebServerLauncher" />
</list>
</recent_temporary>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-bf35d07a577b-intellij.indexing.shared.core-IU-252.26199.169" />
<option value="bundled-js-predefined-d6986cc7102b-9c94529fcfe0-JavaScript-IU-252.26199.169" />
</set>
</attachedChunks>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="930be402-38f2-457f-a7c9-03283f791020" name="Changes" comment="" />
<created>1762161015103</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1762161015103</updated>
<workItem from="1762161017091" duration="4158000" />
<workItem from="1762216705929" duration="9043000" />
<workItem from="1762235183363" duration="6418000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
</project>
22 changes: 0 additions & 22 deletions src/main/java/WebServerLauncher.java

This file was deleted.

41 changes: 0 additions & 41 deletions src/main/java/core/db/MemoryUserRepository.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/java/core/db/Repository.java

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/java/core/jdbc/ConnectionManager.java

This file was deleted.

Loading