Turn: displaytag to use hodgepodge

2009-07-13  来源:本站原创  分类:Web  人气:295 

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="org.displaytag.decorator.TotalTableDecorator"%>
<%@ include file="/inc/tool.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">  

    <title>displaytag Label example  </title>  

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--link rel="stylesheet" type="text/css" href="/css/site.css"-->  

    <style>
     body,td{font:normal 12px Verdana;color:#333333}
     input,textarea,select,td,{font:normal 12px Verdana;color:#333333;border:1px solid #999999;background:#ffffff}
     th{font:normal 14px Verdana;color:#333333;border:1px solid #999999;background:#C0C0C0}
     table{border-collapse:collapse;}
     td{padding:3px}
     input{height:20;}
     textarea{width:80%;height:50px;overfmin:auto;}
     form{display:inline}
     table{width: 100%;}
    </style>
  </head>
   <jsp:scriptlet>
        TotalTableDecorator tt=new TotalTableDecorator();
        tt.setSubtotalLabel("{0}  Subtotal  ");
        tt.setTotalLabel(" Totals  ");
        request.setAttribute("total",tt);
   </jsp:scriptlet>
  <body>
  <h2>displaytag The sample program  </h2>
    <display:table name="result" pagesize="10" requestURI="user.do" export="true" defaultsort="2" defaultorder="ascending" decorator="total">
        <display:caption> This is an example  </display:caption>
        <display:column title=" Ordinal number  ">${row_rowNum}</display:column>  

        <display:column property="country" title=" National  " sortable="true" group="1"/>
        <display:column property="city" title=" City  " sortable="true" />
        <display:column property="name" title=" Name  " paramId="id" href="user.do?method=getList" paramProperty="id" sortable="true"/>
        <display:column property="sex" title=" Gender  " sortable="true"/>
        <display:column property="id" title="ID" sortable="true" />
        <display:column property="email" title=" E-mail address  " sortable="true"/>
        <display:column property="password" title=" Password  " sortable="true"/>  

        <display:column property="birthDate" title=" Date of birth  " format="{0,date,yyyy-MM-dd}" sortable="true"/>
        <display:column property="mobilePhone" title=" Mobile phone  " sortable="true"/>
        <display:column title=" Address  " sortable="true">${row.address }</display:column>
        <display:column property="laborage" title=" Wages  " sortable="true" total="true" format="{0,number,0,000.00}"/>
        <display:column property="performance" title=" Performance  " sortable="true" total="true" format="{0,number,00.0}"/>
        <display:column title=" Operation  "><a href="<%=path %>/user.do?method=getList&id=${row.id }"> Modify  </a> |  View  |  Delete  </display:column>
    </display:table>  

<hr>
  pagesize="3" :  Paging  , Each page 3 data  <br>
  requestURI="user.do" : Paging jump address  <br>
  sortable="true" :  The column can be sorted  <br>
  defaultsort="3" :  The default sort by the column ordinal  <br>
  defaultorder="ascending" :  The default sort order  : Has the ascending and descending  <br>
  group="1" :  Displays the current column grouping  <br>
  total="true" :  Statistics of the current column  , Grouping can be automatically statistics for each set of subtotals  . But the need in the table to join decorator  ="org.displaytag.decorator.TotalTableDecorator" Label  <br>
  export="true" :  According to the displaytag  .properties File configuration  , Export different types of files  <br>
  maxLength="60" :  Limit the string length is 60 characters  <br>
  property="nullValue" nulls="false" :  Indicates that the cell value is blank  , That is not displayed  <br>
  format="email is {0}" :  Formatted email address  , As email is elitr  [email protected]<br>
  format="{0,date,dd-MM-yyyy}" :  Format a date  , Displayed as 11  -08-2008<br>
  format="{0,number,0,000.00} $" :  Format the amount  , Shows four  ,909.00 $<br>
  </body>
</html>
相关文章
  • Turn: displaytag to use hodgepodge 2009-07-13

    <%@ page language="java" pageEncoding="UTF-8"%> <%@ page import="org.displaytag.decorator.TotalTableDecorator"%> <%@ include file="/inc/tool.jsp" %> <% String path = request.getContextPath(); St

  • struts2 + displaytag Inappropriate OGNL expression when you turn the solution (solution) 2010-10-23

    Sure other people must experience this problem: struts2 + displaytag page will appear the following stack information, although the program can run up, but still makes people very uncomfortable. ognl.InappropriateExpressionException: Inappropriate OG

  • displaytag paging tag 2010-03-31

    http://displaytag.sourceforge.net/11/download.html <? Xml version = "1.0" encoding = "GBK"?> <! DOCTYPE taglib PUBLIC "- / / Sun Microsystems, Inc. / / DTD JSP Tag Library 1.2 / / EN" " http://java.sun.com/dtd/w

  • js couplets can turn off ads rolling code 2009-03-18

    Part couplet at a rolling code, including flash ads and pictures after the question of the need to have a friend can turn off the ads couplet js code, Searched and found Figure presentation is as follows: Demo Address: jsad-code-for-couplet-scroll-38

  • Javascript control onbeforeunload refresh or turn off time 2009-04-25

    Recently, the project required to do a turn off IE's prompt window before the case. Internet search a bit in this regard: In fact, is a question of onbeforeunload Ways For example turn off the upper right corner, use onbeforeunload to call the functi

  • js browser to determine whether or not turn off 2009-05-03

    js only tag onload \ onunload \ onbeforeunload case, but not OnClose case. Whether or turn off the page are refreshed every case the implementation of onunload. How to turn off the page to capture it? Implementation only when a page is loaded onload

  • Spring commonly used in hql query methods (getHibernateTemplate ()) (turn) 2010-03-29

    Spring commonly used in hql query methods (getHibernateTemplate ()) (turn) Spring commonly used in hql query methods (getHibernateTemplate ()) --------------------------------- 1, find (String queryString); Example: this.getHibernateTemplate (). Find

  • Java Virtual Machine (JVM) parameters configuration instructions (turn) 2010-03-29

    Java Virtual Machine (JVM) parameters configuration instructions In Java, J2EE large-scale applications, JVM configuration of non-standard parameter is directly related to the overall system performance. Non-standard JVM is a JVM parameter refers to

  • (Turn) proficient in JavaScript DOM events 2009-01-22

    Event (I) JavaScript Event List Event explain the general onclick event to trigger this event when the mouse clicks ondblclick this event is triggered when the mouse double-click the onmousedown This event is triggered by pressing the mouse onmouseup

  • ext commonly used skills (turn) 2008-06-29

    ext commonly used skills (turn) Java code grid.getStore (). proxy.conn.url = "xxx.jsp"; grid.getStore (). reload (); Ext.data.Store Village baseParams and Store.load ((params :{}}) the difference: baseParams where there is always a parameter, wh

  • (Turn) Java Virtual Machine (JVM) parameters configuration instructions 2008-12-30

    Java Virtual Machine (JVM) parameters configuration instructions In Java, J2EE large-scale applications, JVM configuration of non-standard parameter is directly related to the overall system performance. Non-standard JVM is a JVM parameter refers to

  • Turn: javascript pop-up window code complete 2010-01-04

    How to use various forms of Web pop-up window, I think we mostly know more, but that a wide range of pop-up window out how the practice, we today learn about: 1. Shells Kai a full-screen window <html> <body onload="window.open('http://www.ku

  • javascript methods and techniques Daquan 1 (turn) 2008-11-10

    javascript methods and techniques Daquan (change) JavaScript that's all one: the basics Create a script block 1: <script language="JavaScript"> 2: JavaScript code goes here 3: </ script> Hide the script code 2 1: <script language=

  • (Turn) EL Expression 2008-10-09

    1, EL Introduction 1. Grammatical structure $ (expression) 2. [] And. Operator EL offers. And [] two kinds of operators to access the data. When you want to access the property name contains some special characters, such as. Or? Such as letters or nu

  • Turn: WebSphere Optimization Tips 2009-04-26

    Transfer from: http://www.webspherechina.net/club/viewthread.php?tid=12871&pid=77256&page=1&extra = # pid77256 1, change the http server's configuration file parameters KeepAlive. Cause: This value indicating whether to keep the client and HTT

  • Spiral Matrix (clockwise in turn) 2009-10-15

    import java.util.Arrays; public class SpiralMatrix { /** * @param args * @author zhangshaonian */ public static void main(String[] args) { int[][] base = spiralMatrix(3); for (int i = 0; i < base.length; i++) { System.out.println(Arrays.toString(base

  • Cloud-Foundry to make your site turn up! 2010-03-22

    Cloud-Foundry is the enterprise-class Java camp in a cloud recruits, developers can rely on in a public cloud environments to deploy and manage Spring, Grails, and Java applications. So how CloudFoundry Management AWS (Amazon Web Services) on an inst

  • displayTag Learning Summary 2010-03-31

    1.tableTag in the name attribute: the value of the default scope: request <display:table name="accList"> If the scope for the session, the <display:table name="sessionScope.accList"> tableTag will specify the ID attribute o

  • displaytag with struts tag interaction between 2010-03-31

    Do not know why, in <display:table> in OGNL expressions can not access one iteration of the property value. Such as: <display:table name= "${backendListOwnerAction.currentDisplayList}" pagesize= "10" "ownerTable">

  • Application of large amounts of data to complete the paging displaytag examples show 2010-03-31

    Completed application displaytag in struts page shows a large amount of data, Oracle Database JSP file: <% ... @ Taglib uri = "/ WEB-INF/displaytag.tld" prefix = "disp"%> <Disp: table name = "resultList" export = &qu