
์ธํฐ์ ํฐ๋ ์์ฒญ์ด ๋ค์ด๊ฐ๊ธฐ ์ ์ ๊ฐ์ ธ๊ฐ์ ํ์ธํ๋๊ฒ -> ๊ณตํต์ฒ๋ฆฌ ์ธํฐ์ ํฐ ์ฌ์ฉ์ HandlerInterceptorAdapter์ ์์๋ฐ์์ผํ๋ค. Commons BasicInterceptor public class BasicInterceptor extends HandlerInterceptorAdapter { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { //๋ก๊ทธ์ธ์ด ์๋์ด์์ผ๋ฉด ์ ๊ทผํ๋ฉด ์๋๋ ํ์ด์ง ๊ฑฐ๋ฅด๋ ์ธํฐ์ ํฐ //์ธ์ ๊ฐ์ ธ์ค๊ธฐ HttpSession session = request.getSession(); //์ธ์ ์ lo..

ํ๋ก์, ํ๋ก์ ๋ฆฌ์คํธ๋ฅผ ์กฐํํ๋ ๊ฒ์ ๊ฐ์ธ ํ์ด์ง๋ฅผ ์กฐํํ ๋ ๋ณด์ฌ์ค์ผํ๊ธฐ ๋๋ฌธ์ PostsController์์ ์ฌ์ฉํ๊ฒ ๋๋ค. Controller PostsController @Autowired private IFollowService followService; IFollowService ์๋์ฃผ์ //personal-list ์์ฒญ : ๊ฐ์ธ ๊ฒ์๋ฌผ ๋ณด์ด๋ ํ์ด์ง @RequestMapping(value="/{id}", method=RequestMethod.GET) public String personalList(@PathVariable String id, Model model, HttpSession session) throws Exception { //๊ฐ์ธ ํ์ด์ง ์ฃผ์ธ ์ ๋ณด ๋ด๊ธฐ UsersVO user..
Controller FollowController //ํ๋ก์ฐ ์์ฒญ @PostMapping("/follow/{id}") public String follow(@PathVariable String id, HttpSession session, Model model) throws Exception { logger.info("/follow/" + id + " : ํ๋ก์ฐ ์์ฒญ "); Object object = session.getAttribute("login"); UsersVO activeUser = (UsersVO)object; UsersVO passiveUser = usersService.inquiryOfUserById(id); FollowVO follow = new FollowVO(); follow.setA..
ํ์คํ๊ทธ๋จ์ ๋ง๋ค๋ฉด์ ๊ฐ์ฅ ๋จธ๋ฆฌ๊ฐ ์ํ ๋ ๋ถ๋ถ์ด ํ๋ก์ฐ ๋ถ๋ถ์ด์๋ค. ํ์์ด๋ ๊ฒ์๊ธ ๊ฐ์ ๊ฒฝ์ฐ ๋ค๋ฅธ ๊ฒ์ํ ํ์ด์ง์ ํ์ด ๋น์ทํด์ ์๊ฐ๋ณด๋ค ์์ํ๊ฒ ๋ง๋ค์ ์์์ง๋ง ํ๋ก์ฐ๋ DB๊ตฌ์ฑ๋ ์ด๋ป๊ฒ ํด์ผํ ์ง ๋ง๋งํ๋ค. Model FollowVO @Setter @Getter @ToString public class FollowVO { private int followNo; private int activeUser; private int passiveUser; private Date regDate; private String activeUserId; private String passiveUserId; private String profileName; } ์ฐ์ DB์๋ ํ๋ก์ฐ๋ฒํธ, ํ๋ก์ฐ๊ฑด์ ์ , ํ๋ก์ฐ๋นํ์ ์ , ํ..

Controller PostsController //๊ฒ์๊ธ ์ญ์ ์์ฒญ @RequestMapping(value="delete", method=RequestMethod.POST) public String write(@RequestParam("postNo") int postNo, @RequestParam("id") String id) throws Exception { logger.info("์ญ์ ์์ฒญ ๋ฐ์ ๊ฐํ์ธ postNo : " + postNo + " id : " + id); postsService.deletePost(postNo); return "redirect:/post/"+id; } ์ญ์ ๋ ๊ธ๋ฒํธ์ ์์ฑํ ์ ์ ๋ฒํธ๋ฅผ ๋ฐ์์จ๋ค. ์ญ์ ์์ฒญ ํ ๊ฐ์ธ ํ์ด์ง๋ก ์ด๋ํ๋๋ฐ ์ ์ ์์ด๋๋ฅผ ์ฌ์ฉํ๋ค. Servi..

Controller PostsController //๊ฒ์๊ธ ์์ฑ ํ์ด์ง personal-write.jsp ์์ฒญ @RequestMapping(value="/{id}/personal-write", method=RequestMethod.GET) public String personalWrite(@PathVariable String id, Model model, HttpSession session) throws Exception { //id๋ก ํ์์ ๋ชจ๋ ์ ๋ณด ์กฐํ UsersVO user = usersService.inquiryOfUserById(id); //๋ก๊ทธ์ธํ ํ์ (=๋) ์ ๋ณด ๋ด๊ธฐ Object object = session.getAttribute("login"); UsersVO loginUser = ..

Controller PostsController //์ ๋ก๋ ์ฌ์ง ํ์ผ ๋ถ๋ฌ์ค๊ธฐ ์์ฒญ @RequestMapping("/file/{postNo}") public ResponseEntity getFile(@PathVariable int postNo) throws Exception { logger.info("/post/file/" + postNo + " -> POST ์์ฒญ ๋ฐ์ ! " ); PostsVO file = postsService.getFile(postNo); logger.info("postNo๋ก ์กฐํํ ํ์ผ file : " + file); //ํ์ผ์ ํด๋ผ์ด์ธํธ๋ก ์ ์กํ๊ธฐ ์ํด ์ ์ก์ ๋ณด๋ฅผ ๋ด์ ํค๋๋ฅผ ์ค์ ํ๋ค. HttpHeaders headers = new HttpHeaders(); String[] f..
Model PostsVO ๊ฒ์๊ธ ๋ชจ๋ธ ์์ฑ package com.hastagram.myapp.posts.model; import java.sql.Date; import org.springframework.web.multipart.MultipartFile; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Setter @Getter @ToString(exclude="fileData") public class PostsVO { //๊ธฐ๋ณธ ํ๋ private int postNo;//๊ฒ์๊ธ ๋ฒํธ private String caption;//๋ด์ฉ private Date regDate;//๋ฑ๋ก์ผ private int userNo;//์ ์ ๋ฒํธ ..
- Total
- Today
- Yesterday
- ์ ์ฒด๊ฒ์๋ฌผ ์กฐํ
- ๋ถํธ ์๋์์ฑ
- Java
- ์จ๋ฆฌ์์ค
- typeAliases
- ๊ฒ์ํ๋ง๋ค๊ธฐ
- ๊ฒ์๋ฌผ์กฐํ
- mysql์ค์น
- ๊ฐ๋ฐ
- ๋ณ๋ช ์ฒ๋ฆฌ
- ๊ฐ๋ฐํ๊ฒฝ๊ตฌ์ถ
- Algorithm
- ์ดํด๋ฆฝ์ค ํ๊ธ ์ธ์ฝ๋ฉ
- ์๋ฃ๊ตฌ์กฐ
- ๊ฒ์๋ฌผ ์ญ์
- ๊ฒ์ํ ์ญ์
- ์คํ๋ง๋ถํธ ์๋์์ฑ
- java ํ๊ฒฝ๋ณ์
- tomcat์ค์น
- java jdk ์ค์น
- ์ดํด๋ฆฝ์ค ์ค์น
- ๊ฒ์ํ ์กฐํ
- ์๋ฐ
- ์๊ณ ๋ฆฌ์ฆ
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |