读书人

关于struts-jquery-plugin中Remote Li

发布时间: 2012-08-27 21:21:56 作者: rapoo

关于struts-jquery-plugin中Remote Link AnchorTag 的使用



?(一)anchortag.jsp代码的编写:

<?xml version="1.0" encoding="utf-8"?><%@ taglib prefix="s" uri="/struts-tags"%><%@ taglib prefix="sj" uri="/struts-jquery-tags"%><%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>    <title>AnchorTag 的使用</title>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link href="styles/layout.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="/js/showcase.js"></script>   <sj:head   locale="zh_CN"    loadAtOnce="true"    compressed="false"    jquerytheme="showcase"    customBasepath="themes"    loadFromGoogle="false"    debug="true"    />  </head><body><div id="result">Div 1</div><s:urlid="ajax"value="ajax1" /><sj:aid="ajaxlink"href="%{ajax}"targets="result"indicator="indicator"button="true">  请求</sj:a></body></html>

?(二)action的编写:

package com.anchorajax;import com.opensymphony.xwork2.ActionSupport;public class AjaxAnchor extends ActionSupport{    public String execute() throws Exception {        return SUCCESS;    }}

?(三)struts.xml的编写:

<!-- anhorTag的使用 -->   <action name="ajax1" name="code">Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer utneque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc.Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabiturmalesuada. Vestibulum a velit eu ante scelerisque vulputate.

?(五)效果:


关于struts-jquery-plugin中Remote Link AnchorTag  的运用
?(六)为了有请求等待的小图标:可以加上

<sj:aid="ajaxlink"href="%{ajax}"targets="result,div2"indicator="indicator"button="true"effect="shake"><span src="images/indicator.gif" style="display:none"/>  请求</sj:a>
?

读书人网 >Web前端

热点推荐