public class Appserveraction extends Baseaction {
/**
*
*/
/**
* Initialize the "My Products" list jsp page, with paging function
*
* @param request
* @param model
* @return
*/
@Autowired
Private Studentservice Stuservice;
Private map<string, object> datamap;//citation Map is an interface, can not be new out of the interface object, HashMap is the class can be new out of the object, here to use the Map object, but not directly with the map, So we're going to new a hashmap subclass.
//
Public String showstudent () {
Datamap=new hashmap<string, object> ();
int Allaount=stuservice.getcount ();//total number of bars
List<student> stu=stuservice.selectpage (Super.total,super.offset);
Datamap.put ("Total", stu.size ());
Datamap.put ("Rows", Stu);
return SUCCESS;
}
Public Studentservice Getstuservice () {
return stuservice;
}
public void Setstuservice (Studentservice stuservice) {
This.stuservice = Stuservice;
}
Public map<string, Object> Getdatamap () {
return DATAMAP;
}
public void Setdatamap (map<string, object> dataMap) {
This.datamap = DataMap;
}
}
The ToString () method must be added to the entity.
@Override
Public String toString () {
Return "Student [stu_id=" + stu_id + ", stu_name=" + stu_name
+ ", stu_age=" + Stu_age + ", stu_sex=" + Stu_sex + "]";
}
The ToString () method is automatically generated in the entity before the specific data can be put into the datamap.
[email protected], [email protected] No data in the entity