在struts中,如何取出ActionForm内的值?
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)throws Exception{
String name=request.getParameter("name");
String tel=request.getParameter("tel");
String post=request.getParameter("post");
String id=UUID.getUUID();
//String name=((WordForm)form).getName();
//String tel=((WordForm)form).getTel();
//String post=((WordForm)form).getPost();
用request.getParameter()方法可以,但感觉是绕过了ActionForm,想从form中取,但总是有错误.
错误的内容为:inconvertible types
found: org.apache.struts.action.ActionForm (我已经导入此包)
required: redwave.form.WordForm
在下刚学struts,还请有知道的朋友指点一下,谢谢!