Entity. student@150f3932, entity. STUDENT@1A740C6B no data in an entity

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.