关于struts-jquey-plugin中的使用

(一).DivTag.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>DivTag 的使用</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>
		<s:url id="ajaxTest" value="ajax1"/>
    <sj:div href="%{ajaxTest}">Initial Content</sj:div>
	</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下的配置:

<action name="ajax1" class="com.anchorajax.AjaxAnchor">
   			<result name="success">/ajax1.jsp</result>
   		</action>

 (四)ajax1.jsp的写法:

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut
neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc.
Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur
malesuada. Vestibulum a velit eu ante scelerisque vulputate.

 (五)显示界面:


关于struts-jquey-plugin中<sj:div/>的使用_第1张图片

(六)、加入一点特效:

<sj:div
			href="%{ajaxTest}"
			indicator="indicator"
			effect="pulsate"
			effectDuration="1500">
			<img
				id="indicator"
				src="images/indicator.gif"
				style="display: none" />
            Initial Content</sj:div>
 

你可能感兴趣的:(struts)