Struts2 中操作类中的以下行等效于什么:
if(actionError.get("myError").hasNext()){
....
}
最佳答案
ActionSupport
类中有一个方法 getActionErrors()
您可以与代码一起使用
getActionErrors Collection<String> getActionErrors() Get the `Collection` of Action-level error messages for this action.
Error messages should not be added directly here, as implementations are free to return a new
Collection
or an Unmodifiable Collection.Returns: Collection of String error messages
和
if (getActionErrors().contains("myError")) {
//your code here
}
关于java - Struts2 等效项 - actionError.get().hasNext(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42905050/