해결된 질문
작성
·
116
0
import hello.servlet.domain.member.Member;
import hello.servlet.domain.member.MemberRepository;
import hello.servlet.web.frontcontroller.ModelView;
import hello.servlet.web.frontcontroller.v3.ControllerV3;
import java.util.Map;
public class MemberSaveControllerV3 implements ControllerV3 {
private MemberRepository memberRepository = MemberRepository.getInstance();
@Override
public ModelView process(Map<String, String> paraMap) {
String username = paraMap.get("username");
int age = Integer.parseInt(paraMap.get("age"));
Member member = new Member(username, age);
memberRepository.save(member);
ModelView mv = new ModelView("save-result");
mv.getModel().put("member", member);
return mv;
}
}
안녕하세요 .
mv.getModel().put("member", member);
'put(java.lang.String, java.util.Objects)' in 'java.util.Map' cannot be applied to '(java.lang.String, hello.servlet.domain.member.Member)'
요청 타입은 오브젝트이지만 제공된 것은 Member가 제공되어 다음 단계로 진행을 못하고 있습니다.
안녕하세요 저의 모델뷰 코드를 복사해서 올립니다.