parent
60dca6774e
commit
4ea58d259b
@ -0,0 +1,14 @@
|
|||||||
|
package com.ssm.controller;
|
||||||
|
|
||||||
|
import com.ssm.entity.User;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
public class MessageController { @RequestMapping("Message")
|
||||||
|
public ModelAndView test(User Message){
|
||||||
|
Message.printInfo();
|
||||||
|
System.out.println("信息管理:"+Message.toString());
|
||||||
|
ModelAndView mv = new ModelAndView("showMessage");
|
||||||
|
mv.addObject("printInfo", Message);
|
||||||
|
return mv;
|
||||||
|
}}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.ssm.entity;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class Message {
|
||||||
|
private Integer id;
|
||||||
|
private String gender;
|
||||||
|
private String Name;
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String text;
|
||||||
|
|
||||||
|
public Integer getid() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGender() {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printInfo(){
|
||||||
|
System.out.println("用户id="+id +"\n用户性别="+gender+"\n用户姓名="+Name+"\n用户邮箱="+email+"\n用户留言文本="+text);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue