网上找了一下用法,不过看的不痛快,自己查了下文档
这个是template和theme定义,要理解的就是theme是一系列templates包含在一起提供的普遍功能,它是针对很多template而言的,而template是有特定的tag参照的
这是simple theme定义,而为什么fielderror不起作用,之后说
上面说可以通过重写template,复制到application来overridden之前的template
并且提示用freemaker来写
上面说template由template directory 和theme name决定。还提示我们可以写.ftl 在application 或者classpath路径来被搜索到,言外之意就是写在上面其中一个路径就可以覆盖之前的template。这里我说下,你可以放在eclipse src里(相当于classpath),也可以放到WebContent里(相当于application)。
那么template directory位于哪呢?查看struts.properties
template这个路径下面。。
再来看
让我们解压struts-core.jar,找到fielderror
发现在template/simple里面有fielderror.ftl而template/xhtml里面没有,这就是之前改了theme=simple s:fielderror标签还有ul的原因(自己想想)
打开fielderror.ftl就可以修改了,注意这个提示
我们只要编辑原先的就可以了