在URL中注入输入值

时间:2019-02-17 18:11:47

标签: spring spring-mvc

@RequestMapping(“ / showStudent”)     public String showUpdateForm(@RequestParam(“ customerName”)字符串名称,模型模型){

    Student stu = studentService.getByName(name);


    model.addAttribute("student", stu);

    return "showStudent";
}

enter code here
<form:form  action = "showStudent" modelAttribute = "student" method="POST">
        <form:input type = "text" min="1" path = "${student.firstName}"/>
        <input type ="submit" value="${student.firstName}"/>

0 个答案:

没有答案