基于prototype.js的ajax分页
这是一个基于prototype.js的ajax分页,运用了spring框架,自定义分页标签,每次进入列表页面时,把列表存入session,分页只对session存储的列表进行分页,不需要再去查询数据库,性能会高些
首先在web.xml中配置spring监听和servlet
web.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:com/kt/application/application-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>root-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>root-dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
还需要在WEB-INF下建个root-dispatcher-servlet.xml的文件(没有这个文件会报错,为什么少了这个会出错就不知道了)
root-dispatcher-servlet.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
x
相关文档:
项目中想用ajax
,于是在网上扒了
n
多资料,犯了
n
多错误,从今天上班到现在一直在处理这个问题,终于还是把它解决了。
当我看到页面的ajax
显示后,我兴奋异常,为了记录自己学习的
ajax
历程,也为了让更多的人少走弯路,特写此一文以记之!
废话不说了,为了更好的理解,我重做了一个小的项 ......
have been studying parsing JSON from PHP using AJAX to display it in
the client side and jQuery had been a great help to me. Here is a very
simple code in parsing JSON using jQuery that i made.
tablejsondata.php
This file makes the request to a php file and displays the returned data into a tabl ......
首先在fademo.mxml中声明一个button,并添加一个btnClick方法:
view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
......
3.4理解继承
一.基于原型的继承:
步骤:
(1)在子类构造函数中调用基类构造函数,从而继承基类的属性。
(2)将基类的一个新实例赋给子类,从而继承基类的方法。
Samples.Cat=function()
{
Samples.Pet.call(this);
}
Sample ......