Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hung #57

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Hung #57

wants to merge 3 commits into from

Conversation

Hungs20
Copy link
Contributor

@Hungs20 Hungs20 commented Jun 28, 2019

No description provided.

Copy link
Contributor

@quytm quytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Push thừa: thư mục .idea, target

import java.util.Optional;

@RestController
public class UserController {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Đáng ra phải là UserService chứ?
e nên nhớ: có 3 tầng chính mà mình phải định nghĩa: Repo, Service, Controller



@Autowired
private UserController userController;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

không được phép gọi Controller trong 1 controller khác

return "add";
}
@PostMapping("add")
public String submitFormAdd(@RequestParam("name") String name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e k cần đẩy lên từng field một như thế này, sử dụng @ModelAttribute để đẩy lên cả đối tượng User
có thể tham khảo code phía bạn VuVanTung

return "edit";
}
@PostMapping("edit/{id}")
public String submitEdit(@PathVariable("id") Long id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tương tự trên, dùng @ModelAttribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants