MVC 프레임워크 1단계 실습#3
Merged
javajigi merged 13 commits intocode-squad:brainbackdoorfrom Nov 3, 2017
brainbackdoor:brainbackdoor
Merged
MVC 프레임워크 1단계 실습#3javajigi merged 13 commits intocode-squad:brainbackdoorfrom brainbackdoor:brainbackdoor
javajigi merged 13 commits intocode-squad:brainbackdoorfrom
brainbackdoor:brainbackdoor
Conversation
javajigi
suggested changes
Oct 30, 2017
| @Override | ||
| public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{ | ||
| RequestMapping requestmapping = new RequestMapping(); | ||
| requestmapping.init(); |
Contributor
There was a problem hiding this comment.
이와 같이 구현할 경우 발생하는 이유는 뭘까요?
사용자 요청이 있을 때마다 초기화 작업을 진행하게 됨.
| Controller controller = requestmapping.getController(req.getRequestURI()); | ||
| try { | ||
| String view = controller.execute(req, resp); | ||
| JspView jspView = new JspView(view); |
Contributor
There was a problem hiding this comment.
1단계 실습은 JspView를 사용하지 말고 구현하는 것임.
JspView를 사용하지 말고 구현해 볼 것을 추천함.
|
|
||
| @Override | ||
| public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception { | ||
| return "index.jsp"; |
Contributor
There was a problem hiding this comment.
req.setAttribute("users", DataBase.findAll());
jsp에 데이터를 전달하는 부분이 있어야 되지 않을까?
Author
There was a problem hiding this comment.
index.jsp에서는 users 데이터를 사용하지 않는것 같아서 url만 리턴하였습니다.
|
|
||
| @WebServlet(value = { "/users/login", "/users/loginForm" }) | ||
| public class LoginController extends HttpServlet { | ||
| public class LoginController extends HttpServlet implements Controller { |
Contributor
There was a problem hiding this comment.
더 이상 HttpServlet을 상속할 필요가 없음.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MVC 프레임워크 1단계 실습