์ทจ์ 31 ํ์ด์ฌ - function ''' functoin func(,){ } ''' def func(): print('func()ํธ์ถ') func() ''' func()ํธ์ถ ''' def funcRange(val, n): for i in range(n): print(val) funcRange("์๋ ", 3) ''' ์๋ ์๋ ์๋ ''' #๊ฐ๋ณ์ธ์(์ธ์) func() def funcRange1(n, *values): for i in range(n): for v in values: print(v) print() funcRange1(3,"์๋ ","ํ์ด","ํ์ด์ฌ") #default ์ธ์ def funcRange2(value, n=3): for i in range(n): print(value) funcRange2("์๋ ํ์ธ์") #defaul.. 2021. 6. 29. Spring ํ์ผ ์ ๋ก๋ @RequestMapping(value="pdsupload.do", method = {RequestMethod.GET,RequestMethod.POST}) public String pdsupload(PdsDto pdsdto, @RequestParam(value="fileload", required = false)MultipartFile fileload, HttpServletRequest req, HttpSession session) { //๊ฐ๋ค์ด์ค๋์งํ์ธ System.out.println("pdsdto: " + pdsdto.toString()); MemberDto mem = (MemberDto)session.getAttribute("login"); //@RequestParam(value="fileload.. 2021. 6. 24. ์คํ๋ง Tiles๋ฅผ ํ์ฉํ ๊ฒ์ํ ๋ง๋ค๊ธฐ (๊ฒ์ํ ํ์ด์ง, ๊ฒ์) ๋ก๊ทธ์ธ ์ฑ๊ณต์ ๊ฒ์ํ์ผ๋ก ์ด๋ bbslist.do @RequestMapping(value = "loginAf.do", method=RequestMethod.POST) public String loginAf(MemberDto dto, HttpServletRequest req) { MemberDto login = service.login(dto); if(login != null && !login.getId().equals("")) { req.getSession().setAttribute("login", login); //req.getSession().setMaxInactiveInterval(60 * 60 * 24); return "redirect:/bbslist.do"; } else { return "red.. 2021. 6. 22. Spring Model ๊ฐ์ฒด๋ ๋ฌด์์ผ๊น? Spring Model ๊ฐ์ฒด Controller์ ๋ฉ์๋๋ Model์ด๋ผ๋ ํ์ ์ ๊ฐ์ฒด๋ฅผ ํ๋ผ๋ฏธํฐ๋ก ๋ฐ์ ์ ์๋ค. ์์ํ๊ฒ JSP Servlet์ผ๋ก ์น ์ดํ๋ฆฌ์ผ์ด์ ์ ๋ง๋ค ๋ ๋ณดํต request๋ session ๋ด์ฅ๊ฐ์ฒด์ ์ ๋ณด๋ฅผ ๋ด์ jsp์ ๋๊ฒจ์ฃผ๊ณค ํ๋๋ฐ Spring์์๋ Model์ด๋ผ๋ ๋ ์์ ์ด๋ค. ์ฆ request.setAttribute() ์ ๋น์ทํ ์ญํ ์ ํ๋ ๊ฒ. request.setAttribute("time", new java.util.Date()); RequestDispatcher dispatcher = request.getRequestDispatcher("url"); dispatcher.forward(request, response); ์ ์ฝ๋๋ jsp๋ก ๊ฒ์ํ์ ๋ง๋ค๋ ๋ง์ด ์ฌ์ฉ.. 2021. 6. 22. ์ด์ 1 2 3 4 ยทยทยท 8 ๋ค์