加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

dojo 树对象

发布时间:2020-12-16 21:48:25 所属栏目:百科 来源:网络整理
导读:1.在项目中加入struts2-dojo-plugin-2.1.8.jar 2.在jsp页面中加入%@ taglib prefix="sx" uri="/struts-dojo-tags"% 在headsx:head //head !-- 显示树列表 -- sx:tree rootNode="root" nodeIdProperty="id" nodeTitleProperty="name" childCollectionProperty

1.在项目中加入struts2-dojo-plugin-2.1.8.jar

2.在jsp页面中加入<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

在<head><sx:head /></head>

<!-- 显示树列表 -->
<sx:tree rootNode="root" nodeIdProperty="id" nodeTitleProperty="name" childCollectionProperty="childrens"
showRootGrid="true" showGrid="true" id="nodeId">
</sx:tree>

3.在web.xml中的strus2配置如下:

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
若配置如下:

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>

则不能过滤js文件了,会报错,可以加

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.js</url-pattern>
</filter-mapping>

或者直接写成如下

filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读