学习Struts2 jQuery Plugin 3.0

1 篇文章 0 订阅

学习网站推荐:

1、http://www.oschina.net/news/17815/struts2-jquery-plugin-3-0-new-features

2、http://wenku.baidu.com/view/d487e48ecc22bcd126ff0c6b.html 很好的例子

3、http://www.oschina.net/p/struts2-jquery?bp=7  重要

4、http://code.google.com/p/struts2-jquery/wiki/AnchorTag

5、http://www.weinfreund.de/struts2-jquery-showcase/index.action  实例与代码

 

步骤:

1、先建一个web项目

2.导入struts2所需要的jar包,以及此插件的包

3.在web.xml配置好struts2的过滤器

4.在jsp页面引入标签:

5.别忘记在html<head>标签里加上:

6.可以使用插件了;代码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>

<!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">
<sj:head compressed="true" jquerytheme="redmond" ajaxcache="false" />
<title>strut2-jquery-plugin</title>
</head>
<body>
 <!-- 一 -->
 <div id="formResult">Div 1</div>
 <s:url id="ajaxTest" value="/AjaxTest.action" />
 <sj:a id="link1" href="%{ajaxTest}" targets="formResult" indicator="indicator" button="true"
  buttonIcon="ui-icon-refresh">Update Content</sj:a>
 
 <!-- 二 -->
 <s:form id="form" action="echo" theme="simple" cssClass="yform">
  <fieldset>
   <legend>Ajax Form</legend>
   <div class="type-text">
    <label for="echo">Echo: </label>
    <s:textfield id="echo" name="echo" value="Hello World!"></s:textfield>
   </div>
   <div class="type-button">
    <sj:submit targets="formResult" value="Ajax Submit" indicator="indicator"></sj:submit>
    <s:url id="simpleecho" value="/simpleecho.action"></s:url>
    <sj:submit href="%{simpleecho}" targets="formResult" value="Ajax Submit 2" indicator="indicator"></sj:submit>
   </div>
  </fieldset>
 </s:form>
 
 <!-- 四 -->
 <sj:tabbedpanel id="localtabs">
  <sj:tab id="tab1" target="tone" label="Local Tab One"></sj:tab>
  <sj:tab id="tab2" target="ttwo" label="Local Tab Two"></sj:tab>
  <sj:tab id="tab3" target="tthree" label="Local Tab Three"></sj:tab>
  <sj:tab id="tab4" target="tfour" label="Local Tab Four"></sj:tab>
  <div id="tone">Mauris mauris ante</div>
  <div id="ttwo">Sed non urna.</div>
  <div id="tthree">Nam enim risus, molestie et</div>
  <div id="tfour">per inceptors himenaeos.</div>
 </sj:tabbedpanel>
 
 <!-- 五 -->
 <s:form id="form" theme="xhtml">
  <sj:datepicker id="date0" label="Select a Date"></sj:datepicker>
  <sj:datepicker id="date1" label="Date Value from Action" value="%{dateValue}"
   name="date1"></sj:datepicker>
  <sj:datepicker id="date2" name="nameValue" label="Date Value by Name"></sj:datepicker>
  <sj:datepicker id="date3" value="today" name="date3" displayFormat="dd.mm.yy" label="Today"></sj:datepicker>
  <sj:datepicker id="date4" value="yesterday" name="date4" displayFormat="mm/dd/yy" label="Yesterday"></sj:datepicker>
  <sj:datepicker id="date5" value="tomorrow" name="date5" displayFormat="DD, d MM yy" label="Tomorrow"></sj:datepicker>
  <sj:datepicker id="date6" value="2004-08-15" name="date6" displayFormat="d M, yy" label="String value"></sj:datepicker>
 </s:form>
 
 <!-- 六 -->
 <sj:dialog id="mydialog" title="Dialog with local content">
  Mauris mauris ante
 </sj:dialog>
 
 <!-- 七 -->
 <s:url id="urlajax1" action="ajax1"></s:url>
 <sj:accordion id="accordion">
  <sj:accordionItem title="Mauris mauris ante">
   <sj:div id="divInAccrodionItem">afafaagaf</sj:div>
  </sj:accordionItem>
  <sj:accordionItem title="Sed non urna">
   Sed non urna
  </sj:accordionItem>
  <sj:accordionItem title="Nam enim risus">
   Nam enim risus
  </sj:accordionItem>
  <sj:accordionItem title="Cras dictum">
   Cras dictum.
  </sj:accordionItem>
 </sj:accordion>
 
 <!-- 九 -->
 <sj:slider id="simpleslider"></sj:slider>
 

 </body>
</html>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值