Common Jpage pages

Source: Internet
Author: User
The jpage label version will also be the official version of the jpage page. After the label function is introduced, it can be combined with Struts or used independently to better implement the MVC mode.

Method 1 of Jpage paging:

(Implemented using JavaBean)

% @ Page contenttype = "text/html; charset = gb2312" %>
% @ Page import = "Java. util. *" %>

String Path = request. getcontextpath ();
String delepath = path + "/delete table = sys_user &";
%>
 



Data = data. getJpage (); // obtain the data object
String SQL = "select * from admin_view where 1 = 1 ";

// Query Conditions
If (user! = Null &&! User. equals (""))
SQL + = "and m_name like '%" + user + "% '";

If (city! = Null &&! City. equals (""))
SQL + = "and city_name like '%" + city + "% '";

SQL + = "order by m_id desc ";

List list = data. jlist (SQL, "id", request );
// Three parameters: SQL statement, table primary key, request


For (int I = 0; I {
Map map = (HashMap) list. get (I );
%>

}
%>

Serial number User Name Real name Permission range Time Login count Operation
"> Query and modify & pid = m_id" onClick = "return confirm ('Are you sure you want to delete it? ') "> Delete



Jpage paging Method 2:

% @ Page contentType = "text/html; charset = gb2312" %>







Serial number News Title Category Posting Scope Time
"> -



 Actual results:

About Tags:
Tag, and Struts1.2 tag Similar functions, In addition to the functions (that is, the collection in the request or session loops out) and attributes, the SQL, PID, and pagesize attributes are added.

SQL: used to specify the data you want to query.
Pid: The primary key in the table. If it is an sqlserver database, you must specify this primary key. If it is a mysql or oracle database, it can be blank.
Pagesize: the size of each page.

// The tag function is used to find the Attribute named list in the request and session.

// Directly query and pagination:


Postscript:

The goal of Jpage paging is to reduce the workload and improve development efficiency. In the future, we plan to paging the Jpage as part of the jwork framework. The design goal of the jwork framework is to encapsulate all the database business logic, and finally implement the configuration and a small amount of code, business logic can be achieved .!

If you want to use Jpage, please leave a message at www.zuoyefeng.com, attach your email address, and send it to you last night !!

 

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? PostId = 1623352

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.