Home > Back-end >  [for] about JSP to get the data
[for] about JSP to get the data

Time:11-15

In Java:
This is the query all the administrator information:
 
@ RequestMapping ("/admin/pass ")
Public String list (Model Model) {
List List=adminService. QueryAllAdmin ();
Model. The addAttribute (" listAdmin ", a list);
return "index";
}

This is the query all image information:
 
@ RequestMapping ("/index ")
Public String list (Model Model) {
List List=picService. QueryAllPic ();
Model. The addAttribute (" list ", a list);
return "index";
}

They all need to return to the index this page
The front is a JSP
But
If the access is:/admin/pass for less than the picture information
If access is:/index for less than the administrator information
@ RequestMapping path cannot be repeated again, this is a page and just need the two data, what should I do?

CodePudding user response:

JSP is there

Acceptable, so if we can solve this problem, of course, also can change a way of receiving, in this way because I only know this

CodePudding user response:

Add these two lines to the bottom, within that method in the request line,

List List=adminService. QueryAllAdmin ();
Model. The addAttribute (" listAdmin ", a list);

CodePudding user response:

Such complains, Java. Lang. NullPointerException
  • Related