struts2_ three ways to save the result to the value stack



// 2 Store the result in the value stack to facilitate jsp to obtain data
// * Method 1: context (map) stores put(key, value), and the jsp page gets "#key".
// ActionContext.getContext().put(key, value)
// * Mode 2: root (value stack), push (obj), general data is JavaBean or Map, jsp page gets "attribute name" or "key".
// ActionContext.getContext().getValueStack().push(o)
// * Mode 3: root (value stack), set(key, value), general data is List, jsp page gets "key"
// set() the underlying new Map(key,value), push(map)



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325816523&siteId=291194637