日期:2014-05-20  浏览次数:20782 次

ActionForm的抽象方法是哪些?
这个问题有点多余,继承了ActionForm肯定有validate(),reset()方法,但还是想知道具体哪些是抽象的,API文档上好像没说明。。。

------解决方案--------------------
直接把代码下了看吧,有时候struts报错的话,进代码还可以看到原因
------解决方案--------------------
API文档当然有说明,
另外你可以装个反编译工具JAD,直接点进去看CLASS文件
我把整个类拷下来了, 貌似抽象方法reset,validate都给出了空实现。

public abstract class ActionForm implements Serializable {

public ActionForm() {
servlet = null;
}

protected ActionServlet getServlet() {
return servlet;
}

public ActionServletWrapper getServletWrapper() {
return new ActionServletWrapper(getServlet());
}

public MultipartRequestHandler getMultipartRequestHandler() {
return multipartRequestHandler;
}

public void setServlet(ActionServlet servlet) {
this.servlet = servlet;
}

public void setMultipartRequestHandler(
MultipartRequestHandler multipartRequestHandler) {
this.multipartRequestHandler = multipartRequestHandler;
}

public void reset(ActionMapping mapping, ServletRequest request) {
try {
reset(mapping, (HttpServletRequest) request);
} catch (ClassCastException e) {
}
}

public void reset(ActionMapping actionmapping,
HttpServletRequest httpservletrequest) {
}

public ActionErrors validate(ActionMapping mapping, ServletRequest request) {
try {
return validate(mapping, (HttpServletRequest) request);
} catch (ClassCastException e) {
return null;
}
}

public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
return null;
}

protected transient ActionServlet servlet;
protected transient MultipartRequestHandler multipartRequestHandler;
}