免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4785 | 回复: 0
打印 上一主题 下一主题

Struts2.1.8:JQuery(1.6.1)+JSON(2.1.8)集成心得 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-11-10 01:14 |只看该作者 |倒序浏览

Struts2 jQuery Plugin Showcase
示例较多
通过亲自实践,提醒注意以下几点:
1.需要在页面引入标签:
%@ page contentType="text/html; charset=UTF-8" %>
%@ taglib prefix="s" uri="/struts-tags"%>
%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
html>
  head>
      sj:head jqueryui="true"/>
  /head>
该标签的作用是会导入jQuery必须的资源文件,如下所示(IE8开发人员工具截图)

2.如果需要使用效果,动画等特殊JQuery功能,标签需要设置jqueryui="true",相见tld说明
tag>
    description>![CDATA[Render a chunk of HEAD for your HTML file]]>/description>
    name>head/name>
    tag-class>com.jgeppert.struts2.jquery.views.jsp.ui.HeadTag/tag-class>
    body-content>empty/body-content>
    attribute>
      description>![CDATA[If set to false it will force the pages that you request to not be cached by the browser.]]>/description>
      name>ajaxcache/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[BETA!!! If set to true it will enable history and bookmarking for AJAX content and jQuery UI Tabs.]]>/description>
      name>ajaxhistory/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[use compressed version of jquery.js]]>/description>
      name>compressed/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[base path for custom jQuery designs]]>/description>
      name>customBasepath/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[jQuery UI theme]]>/description>
      name>jquerytheme/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[enable jQuery UI Scripts]]>/description>
      name>jqueryui/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[Load JavaScript from google content distribution network]]>/description>
      name>loadFromGoogle/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    attribute>
      description>![CDATA[import jQuery i18n scripts]]>/description>
      name>locale/name>
      required>false/required>
      rtexprvalue>false/rtexprvalue>
    /attribute>
    dynamic-attributes>false/dynamic-attributes>
  /tag>
总的来说jQuery框架语法简介,功能强大。是非常优秀的JS库,基于它开发的UI组件数不胜数。个人觉得Struts 2 JQuery插件,主要是大约十几个标签,对于Ajax,网页动态效果较为突出,可在项目中酌情利用。不足之处是:文档缺乏,基本上无官方文档。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/103146/showart_2090346.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP