hzzzyyy 2015-10-12 15:09 采纳率: 0%
浏览 4165

Struts2框架,s:form表单标签使用theme="ajax"报错

已经导入struts2-dojo-plugin-2.3.24.1.jar,jsp页面如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录页面</title>
    <sx:head />
</head>

<body>
    <s:form action="Login" theme="ajax">
        <table width="60%" height="76" border="0">
            <s:textfield name="username" label="用户名" />
            <s:password name="password" label="密码" />
            <s:submit value="登录" align="center" />
        </table>
    </s:form>

</body>

报运行时以下错误:

FreeMarker template error (HTML_DEBUG mode; use RETHROW in production!)

The following has evaluated to null or missing:
==> parameters.pushId [in template "template/ajax/submit.ftl" at line 103, column 6]


Tip: It's the step after the last dot that caused this error, not those before it.

Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??


FTL stack trace ("~" means nesting-related):

- Failed at: #if parameters.pushId [in template "template/ajax/submit.ftl" at line 103, column 1]

Java stack trace (for programmers):

freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:116)
at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:60)
at freemarker.core.UnexpectedTypeException.(UnexpectedTypeException.java:40)
at freemarker.core.NonBooleanException.(NonBooleanException.java:44)
。。。

去掉则正常,感觉应该是submit少了什么属性,错误提示的parameters.pushId不知道是什么意思,submit应该没pushId属性吧,加上id,form加上name也没用,还是报错。

求大神指点!

  • 写回答

3条回答

  • devmiao 2015-10-12 15:55
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误