日期:2014-05-17  浏览次数:20646 次

srtuts2 使用 radio标签 FreeMarker template error!
本帖最后由 u010233133 于 2013-06-18 11:38:57 编辑
 <%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>请登录您的账号</title>
</head>
<body>
<%@ taglib prefix="s" uri="/struts-tags" %>
 <s:fielderror cssStyle="color:red;"/>
  
<s:form  name="hellosport" action="hellosport"  method="post"  namespace="/sportlogin" id="hellosport" validate="true">
                <s:textfield name="user.username" label="用户名" id="UserName" > </s:textfield><br />
                <s:password  name="user.password" label="密码"> </s:password>  
                <s:radio name="userType" list="#{'1':'普通用户','2':'管理员'}" value="1"></s:radio> 
                <s:submit value="提交"></s:submit>         
</s:form>
  
</body>
</html>

已经导入了freemarker的包了,可是还会出现错误,
FreeMarker template error!
Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String) threw an exception when invoked on org.apache.struts2.components.Form@2d2e2d2e
The problematic instruction:
----------
==> list tag.getValidators("${tagName}") as validator [on line 46, column 9 in template/xhtml/form-close-validate.ftl]
 in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on line 25, column 1 in template/xhtml/form-close.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String) threw an exception when invoked on org.apache.struts2.components.Form@2d2e2d2e