컴퓨터과학
[Spring Framework 특성 살피기] PSA에 대한 이해
광드
2021. 8. 3. 21:37
728x90
반응형
Spring Framework 특성 살피기_ 3. PSA에 대한 이해
ㆍPSA(Portable Service Abstraction) : JSP
ex1) 서블릿 기반 동작 구현 | ex2) PSA : 추상화 객체로 구현 |
// /owner/create호출시 public class OwnerCreateServlet extends HttpServlet{ //GET @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp){ super.doGet(req, resp); } //POST @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp){ super.doPost(req, resp); } } |
class OwnerController{ @GetMapping(“owner/create”) public String initCreationForm (Map<String, Object>model){ Owner owner = new Owner(); model.put(“owner”,owner); return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; } } |
ex3) PSA방식 MVC구현(Model, View, Controller) | |
@Controller //C class OwnerController{ @GetMapping(“owner/create”) public String initCreationForm(Map<String, Object>model){ Owner owner = new Owner(); model.put(“owner”,owner); //M (owner) return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; //V (HTML파일) } } |
}
728x90
반응형