使用<s:tree>时报错了,不知道少哪个包?兄弟门指点一下

yuan29346 2008-11-29
我在生成静态树时报错了
2008-11-29 08:48:30,421 ERROR [org.apache.struts2.components.template.FreemarkerTemplateEngine] - Could not load template /template/xhtml/tree
2008-11-29 08:48:30,421 ERROR [org.apache.struts2.components.ClosingUIBean] - Could not open template
java.io.FileNotFoundException: Template /template/xhtml/tree.ftl not found.

这个莫板在哪个包里放着呢?我缺少了哪个包?
cbywxy 2008-12-08
模板引擎就是struts2的核心包里。你的错误里也能明确的知道啊。
没有缺少包。是你的模板路径没有写对。请在确认你的路径写的正确。
diddyrock 2008-12-09
Template /template/xhtml/tree.ftl not found
yuan29346 2008-12-13
但是在那个包里就是没找到那个文件!很郁闷
最后我放弃了这个标签
自己找了个JS文件搞了个树
kyo100900 2008-12-19
是不是你用的struts2的版本问题?仔细查查看。
cbywxy 2008-12-24
<#--
/*
* $Id: pom.xml 560558 2007-07-28 15:47:10Z apetrelli $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/
-->
<script type="text/javascript">
      <!--
      dojo.require("dojo.lang.*");
      dojo.require("dojo.widget.*");
      dojo.require("dojo.widget.Tree");
      // dojo.hostenv.writeIncludes();
      -->
</script>
<div dojoType="Tree"  
<#if parameters.blankIconSrc?exists>
gridIconSrcT="<@s.url value='${parameters.blankIconSrc}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcL?exists>
gridIconSrcL="<@s.url value='${parameters.gridIconSrcL}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcV?exists>
gridIconSrcV="<@s.url value='${parameters.gridIconSrcV}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcP?exists>
gridIconSrcP="<@s.url value='${parameters.gridIconSrcP}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcC?exists>
gridIconSrcC="<@s.url value='${parameters.gridIconSrcC}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcX?exists>
gridIconSrcX="<@s.url value='${parameters.gridIconSrcX}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcY?exists>
gridIconSrcY="<@s.url value='${parameters.gridIconSrcY}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.gridIconSrcZ?exists>
gridIconSrcZ="<@s.url value='${parameters.gridIconSrcZ}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.expandIconSrcPlus?exists>
expandIconSrcPlus="<@s.url value='${parameters.expandIconSrcPlus}' includeParams='none'/>"
</#if>
<#if parameters.expandIconSrcMinus?exists>
expandIconSrcMinus="<@s.url value='${parameters.expandIconSrcMinus?html}' includeParams='none'/>"
</#if>
<#if parameters.iconWidth?exists>
iconWidth="<@s.url value='${parameters.iconWidth?html}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.iconHeight?exists>
iconHeight="<@s.url value='${parameters.iconHeight?html}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.toggleDuration?exists>
toggleDuration=${parameters.toggleDuration?c}
</#if>
<#if parameters.templateCssPath?exists>
templateCssPath="<@s.url value='${parameters.templateCssPath}' encode="false" includeParams='none'/>"
</#if>
<#if parameters.showGrid?exists>
showGrid="${parameters.showGrid?default(true)?string}"
</#if>
<#if parameters.showRootGrid?exists>
showRootGrid="${parameters.showRootGrid?default(true)?string}"
</#if>
    <#if parameters.id?exists>
    id="${parameters.id?html}"
    </#if>
    <#if parameters.treeSelectedTopic?exists>
    publishSelectionTopic="${parameters.treeSelectedTopic?html}"
    </#if>
    <#if parameters.treeExpandedTopic?exists>
    publishExpandedTopic="${parameters.treeExpandedTopic?html}"
    </#if>
    <#if parameters.treeCollapsedTopic?exists>
    publishCollapsedTopic="${parameters.treeCollapsedTopic?html}"
    </#if>
    <#if parameters.toggle?exists>
    toggle="${parameters.toggle?html}"
    </#if>
    >
    <#if parameters.label?exists>
    <div dojoType="TreeNode" title="${parameters.label?html}"
    <#if parameters.nodeIdProperty?exists>
    id="${stack.findValue(parameters.nodeIdProperty)}"
    <#else>
    id="${parameters.id}_root"
    </#if>
    >
    <#elseif parameters.rootNode?exists>
${stack.push(parameters.rootNode)}
<#list stack.findValue(parameters.childCollectionProperty.toString()) as child>
    ${stack.push(child)}
    <#include "/${parameters.templateDir}/ajax/treenode-include.ftl" />
    <#assign oldNode = stack.pop() /> <#-- pop the node off of the stack, but don't show it -->
</#list>
<#assign oldNode = stack.pop() /> <#-- pop the node off of the stack, but don't show it -->
    </#if>
在WEB-ROOT 下建一个/template/bgtheme/tree.ftl,将上面的内容拷贝到tree.ftl里
<s:tree rootNode="root" nodeIdProperty="id" nodeTitleProperty="name" childCollectionProperty="childrens"
showRootGrid="true"  showGrid="true" theme="bgtheme"  id="nodeId">
</s:tree>
试试吧!!
cbywxy 2008-12-24
页面不要少了<s:head theme="ajax"/>
Global site tag (gtag.js) - Google Analytics