struts2中使用dwr的问题

zxh1121b24 2012-04-09 03:18:50
dwr.xml和web.xml已经配置,register.jsp的代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<!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=UTF-8">
<title>Insert title here</title>

<s:head theme="ajax"/>

</head>
<body>

<s:form action="register" theme="ajax" validate="true" >
<s:textfield name="username" label="输入用户名:"/>
<s:password name="password" label="输入密码:"/>
<s:submit value="发布" cssStyle="width:50px"/>
</s:form>
</body>
</html>

用tomcat运行出现错误:
java.io.FileNotFoundException: Template /template/ajax/head.ftl not found.

找了很多资料都没有解决这个问题,希望有高手指点一下,谢谢。
...全文
164 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
licip 2012-04-10
  • 打赏
  • 举报
回复
你struts2是什么版本,你的模板的没有加到里面呀。
yimail 2012-04-10
  • 打赏
  • 举报
回复
由于你使用了 主题 <s:head theme="ajax"/>

想达到,如果出错了,就在页面的顶部显示出错误提示。

所以你必须在 src目录下面 建立 template,它下面还有个包 ajax,在ajax下面有个文件 head.ftl。这里面就是你 展示错误提示 代码,.ftl文件格式是什么,你网上搜索吧,自己理解的,就属于你自己的东西了。
zhangxiaoyan06 2012-04-10
  • 打赏
  • 举报
回复
head.ftl这个文件没有找到啊!
看看这个文件写了没,位置有没有放对

52,782

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧