Oh, the depressed problem solved

xiaoxiao2021-03-06  65

Map params = actionContext.getContext (). Getparameters ();

It turns out that params is a parameter value in the form of array, and the modified program segment is:

Public Object getModel () {

IF (userdto! = null) Return UserDTo;

Integer PID = NULL;

String Sid = NULL;

Map params = actionContext.getContext (). Getparameters ();

IF (params.get ("id")! = null)

{

SID = (String []) params.get ("ID")) [0];}

IF (SID! = Null &&! Sid.equals ("")) {

Try {

User = userservice.getuserbyid (New Integer (SID));

// PO Convert to DTO

Userdto = New UserDTO (user);

} catch (exception e) {

Log.Error ("This user does not exist", e);

}

} else {

Userdto = new userDTO ();

}

Return Userdto;

}

转载请注明原文地址:https://www.9cbs.com/read-85530.html

New Post(0)