- 浏览: 413473 次
- 性别:
- 来自: 西安
文章分类
最新评论
-
抛出异常的爱:
C_yi 写道界面上,光一个拖拽停靠窗体(IDE常有)就够做的 ...
用网页做一个ide,集中调试、运行,可行吗? -
C_yi:
界面上,光一个拖拽停靠窗体(IDE常有)就够做的了。感觉要搞定 ...
用网页做一个ide,集中调试、运行,可行吗? -
gumutianqi:
kevinhrw 写道@Column(columnDefini ...
hibernate annotation 定义字段的默认值和显示hql的格式化问题 -
nishifei:
真NB , 谢了 。
eclipse与360的冲突 -
zhaoying0326:
可以自动赋值,只要让radiogroup的name和它的ite ...
extjs radiogroup的用法
用jsf实现了翻页功能,主要原理是扩展datamodel和datatabletag
1 扩展datatabletag,增加了几个属性,用于后台执行查询语句
2 dragon.tld
个人不太喜欢这种方式
条件都在页面里了
直接加个总页数,绑定到DataModel(只有一页数据)是否好用些呢
1 扩展datatabletag,增加了几个属性,用于后台执行查询语句
java 代码
- package com.longtop.core.web.jsf.tag;
- import javax.faces.application.Application;
- import javax.faces.component.UIComponent;
- import javax.faces.context.FacesContext;
- import javax.faces.el.ValueBinding;
- import com.sun.faces.taglib.html_basic.DataTableTag;
- public class DataTableWithScrollTag extends DataTableTag {
- private boolean scroll = true;
- private int pageSize = 10;
- private String scrollPageCss = "";
- private String moduleId;
- private String statementId;
- private String beanName;
- private String implType;
- private String searchCondition;
- /**
- * @return the pageSize
- */
- public int getPageSize() {
- return pageSize;
- }
- /**
- * @param pageSize
- * the pageSize to set
- */
- public void setPageSize(int pageSize) {
- this.pageSize = pageSize;
- }
- /**
- * @return the scroll
- */
- public boolean isScroll() {
- return scroll;
- }
- /**
- * @param scroll
- * the scroll to set
- */
- public void setScroll(boolean scroll) {
- this.scroll = scroll;
- }
- public String getComponentType() {
- return "com.longtop.core.web.jsf.render.DataTableWithScrollType";
- }
- public void setProperties(UIComponent component) {
- super.setProperties(component);
- setStringProperty(component, "pageSize", String.valueOf(pageSize));
- setStringProperty(component, "scroll", String.valueOf(scroll));
- setStringProperty(component, "scrollPageCss", scrollPageCss);
- setStringProperty(component, "moduleId", moduleId);
- setStringProperty(component, "statementId", statementId);
- setStringProperty(component, "beanName", beanName);
- setStringProperty(component, "implType", implType);
- setStringProperty(component, "searchCondition", searchCondition);
- }
- private void setStringProperty(UIComponent component, String attrName,
- String attrValue) {
- if (attrValue == null)
- return;
- if (isValueReference(attrValue)) {
- FacesContext context = FacesContext.getCurrentInstance();
- Application application = context.getApplication();
- ValueBinding binding = application.createValueBinding(attrValue);
- component.setValueBinding(attrName, binding);
- } else {
- component.getAttributes().put(attrName, attrValue);
- }
- }
- /**
- * @return the scrollPageCss
- */
- public String getScrollPageCss() {
- return scrollPageCss;
- }
- /**
- * @param scrollPageCss the scrollPageCss to set
- */
- public void setScrollPageCss(String scrollPageCss) {
- this.scrollPageCss = scrollPageCss;
- }
- /**
- * @return the moduleId
- */
- public String getModuleId() {
- return moduleId;
- }
- /**
- * @param moduleId the moduleId to set
- */
- public void setModuleId(String moduleId) {
- this.moduleId = moduleId;
- }
- /**
- * @return the statementId
- */
- public String getStatementId() {
- return statementId;
- }
- /**
- * @param statementId the statementId to set
- */
- public void setStatementId(String statementId) {
- this.statementId = statementId;
- }
- /**
- * @return the beanName
- */
- public String getBeanName() {
- return beanName;
- }
- /**
- * @param beanName the beanName to set
- */
- public void setBeanName(String beanName) {
- this.beanName = beanName;
- }
- /**
- * @return the implType
- */
- public String getImplType() {
- return implType;
- }
- /**
- * @param implType the implType to set
- */
- public void setImplType(String implType) {
- this.implType = implType;
- }
- /**
- * @return the searchCondition
- */
- public String getSearchCondition() {
- return searchCondition;
- }
- /**
- * @param searchCondition the searchCondition to set
- */
- public void setSearchCondition(String searchCondition) {
- this.searchCondition = searchCondition;
- }
- }
2 dragon.tld
xml 代码
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE taglib
- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
- "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
- <taglib>
- <tlib-version>1.0</tlib-version>
- <jsp-version>2.0</jsp-version>
- <short-name>d</short-name>
- <uri>http://com.longtop.net/dataTableWithScroll</uri>
- <tag>
- <name>scrollDataTable</name>
- <tag-class>com.longtop.core.web.jsf.tag.DataTableWithScrollTag</tag-class>
- <tei-class>com.sun.faces.taglib.FacesTagExtraInfo</tei-class>
- <body-content>JSP</body-content>
- <description>
- </description>
- <attribute>
- <name>first</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Zero-relative row number of the first row to be displayed. If this
- property is set to zero, rendering will begin with the first row of
- the underlying data.
- </description>
- </attribute>
- <attribute>
- <name>id</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The component identifier for this component. This value must be
- unique within the closest parent component that is a naming
- container.
- </description>
- </attribute>
- <attribute>
- <name>rendered</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Flag indicating whether or not this component should be rendered
- (during Render Response Phase), or processed on any subsequent
- form submit.
- </description>
- </attribute>
- <attribute>
- <name>rows</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The number of rows to display, starting with the one identified by the
- "first" property. If this value is set to zero, all available rows in
- the underlying data model will be displayed.
- </description>
- </attribute>
- <attribute>
- <name>value</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The current value of this component.
- </description>
- </attribute>
- <attribute>
- <name>var</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Name of a request-scope attribute under which the model data for the
- row selected by the current value of the "rowIndex" property (i.e.
- also the current value of the "rowData" property) will be exposed.
- </description>
- </attribute>
- <attribute>
- <name>bgcolor</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Name or code of the background color for this table.
- </description>
- </attribute>
- <attribute>
- <name>border</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Width (in pixels) of the border to be drawn
- around this table.
- </description>
- </attribute>
- <attribute>
- <name>cellpadding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Definition of how much space the user agent should
- leave between the border of each cell and its contents.
- </description>
- </attribute>
- <attribute>
- <name>cellspacing</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Definition of how much space the user agent should
- leave between the left side of the table and the
- leftmost column, the top of the table and the top of
- the top side of the topmost row, and so on for the
- right and bottom of the table. It also specifies
- the amount of space to leave between cells.
- </description>
- </attribute>
- <attribute>
- <name>columnClasses</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Comma-delimited list of CSS style classes that will be applied
- to the columns of this table. A space separated list of
- classes may also be specified for any individual column. If
- the number of elements in this list is less than the number of
- columns specified in the "columns" attribute, no "class"
- attribute is output for each column greater than the number of
- elements in the list. If the number of elements in the list
- is greater than the number of columns specified in the
- "columns" attribute, the elements at the posisiton in the list
- after the value of the "columns" attribute are ignored.
- </description>
- </attribute>
- <attribute>
- <name>dir</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Direction indication for text that does not inherit directionality.
- Valid values are "LTR" (left-to-right) and "RTL" (right-to-left).
- </description>
- </attribute>
- <attribute>
- <name>footerClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Space-separated list of CSS style class(es) that will be
- applied to any footer generated for this table.
- </description>
- </attribute>
- <attribute>
- <name>frame</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Code specifying which sides of the frame surrounding
- this table will be visible. Valid values are:
- none (no sides, default value); above (top side only);
- below (bottom side only); hsides (top and bottom sides
- only); vsides (right and left sides only); lhs (left
- hand side only); rhs (right hand side only); box
- (all four sides); and border (all four sides).
- </description>
- </attribute>
- <attribute>
- <name>headerClass</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Space-separated list of CSS style class(es) that will be
- applied to any header generated for this table.
- </description>
- </attribute>
- <attribute>
- <name>lang</name>
- <required>false</required>
- <rtexprvalue>false</
评论
10 楼
fishhappy365
2008-01-15
大哥:能给我你这个工程的源代码码?如果可以的话,发到我邮箱中,我的邮箱地址是:
fishhappy365@163.com
fishhappy365@163.com
9 楼
fishhappy365
2008-01-14
大哥:DataTableTag 是final类型的,这个你也能继承?
8 楼
-妞-
2007-11-22
dragon.tld 文件没帖完整,能否帖完整啊?
我也正在用jsf 做分页,可否把你的完整代码发给我啊?
我也正在用jsf 做分页,可否把你的完整代码发给我啊?
7 楼
gapele
2007-09-30
直接用Myfaces的实现岂不是更方便!
6 楼
fourfire
2007-09-21
谢谢你的回复,我有以下考虑
1 我需要提供多种扩充的查询条件的方式,这是一种,这样的话就可以共用后台一个主查询语句了
也可以实现IScrollDataLoad在后台进行条件添加
2 页面上还有用js添加运行期条件的方法
如books2_condition_txt
这样有些模块就不用为了一个条件的变化而写很多的dao方法了,查询业务,简单一些为好
1 我需要提供多种扩充的查询条件的方式,这是一种,这样的话就可以共用后台一个主查询语句了
也可以实现IScrollDataLoad在后台进行条件添加
2 页面上还有用js添加运行期条件的方法
如books2_condition_txt
这样有些模块就不用为了一个条件的变化而写很多的dao方法了,查询业务,简单一些为好
5 楼
john.yi
2007-09-19
引用
<d:scrollDataTable id="books2"
# value="#{TestBean.otherDataModel}" pageSize="10" var="store2" scroll="true" moduleId="tools" statementId="ChineseLetter" beanName="queryHibernate" searchCondition="obj.id like '%A%'" implType="hibernate">
# value="#{TestBean.otherDataModel}" pageSize="10" var="store2" scroll="true" moduleId="tools" statementId="ChineseLetter" beanName="queryHibernate" searchCondition="obj.id like '%A%'" implType="hibernate">
个人不太喜欢这种方式
条件都在页面里了
直接加个总页数,绑定到DataModel(只有一页数据)是否好用些呢
4 楼
fourfire
2007-09-17
测试页面(hibernate实现)
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="/WEB-INF/tld/dragon.tld" prefix="d" %> <style type="text/css"> body { font: 11px Lucida Grande, Verdana, Arial, Helvetica, sans serif; } #progressBar { padding-top: 5px; } #progressBarBox { width: 350px; height: 20px; border: 1px inset; background: #eee;} #progressBarBoxContent { width: 0; height: 20px; border-right: 1px solid #444; background: #9ACB34; } td{border: 1px solid #333;text-align:center;} tr{border: 1px solid #333;text-align:center;} </style> <f:view> <h:form> <d:scrollDataTable id="books2" value="#{TestBean.otherDataModel}" pageSize="10" var="store2" scroll="true" moduleId="tools" statementId="ChineseLetter" beanName="queryHibernate" searchCondition="obj.id like '%A%'" implType="hibernate"> <h:column> <f:facet name="header"> <h:outputText value="A"/> </f:facet> <h:outputText value="#{store2.id}"/> </h:column> <h:column> <h:outputText value="#{store2.letter}"/> </h:column> <h:column> <f:facet name="header"> <h:outputText value="B"/> </f:facet> <h:outputText value="#{store2.chinese}"/> </h:column> </d:scrollDataTable> <input type="button" onclick="document.getElementById('_id0:books2_condition_txt').value='obj.letter like \'%1%\'';alert('');" value="setValue"> </h:form> </f:view> </body> </html>
3 楼
fourfire
2007-09-17
解码器
package com.longtop.core.web.jsf.render; import java.io.IOException; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; import com.longtop.core.web.jsf.model.ScrollDataModel; public class DataTableWithScroll extends javax.faces.component.html.HtmlDataTable { /* * (non-Javadoc) * * @see javax.faces.component.UIData#encodeBegin(javax.faces.context.FacesContext) */ @Override public void encodeBegin(FacesContext context) throws IOException { String clientId = getClientId(context); String currentPage = (String) context.getExternalContext() .getRequestParameterMap().get(clientId + "_txt"); String searchCondition_dynamic = (String) context.getExternalContext() .getRequestParameterMap().get(clientId + "_condition_txt"); ScrollDataModel dataModel = (ScrollDataModel) this.getValue(); dataModel.setImplType((String) this.getAttributes().get("implType")); dataModel.setBeanName((String) this.getAttributes().get("beanName")); dataModel.setStatementId((String) this.getAttributes().get( "statementId")); dataModel.setModuleId((String) this.getAttributes().get("moduleId")); if (currentPage == null || currentPage.trim().length() == 0) { dataModel.setCurrentPage(0); } else { dataModel.setCurrentPage(Integer.parseInt(currentPage)); } String searchCondition_static=(String) this.getAttributes().get("searchCondition"); dataModel.setQueryParam(((searchCondition_static==null||searchCondition_static.trim().length()==0)?"":searchCondition_static)+((searchCondition_dynamic==null||searchCondition_dynamic.trim().length()==0)?" ":" and "+searchCondition_dynamic)); dataModel.loadData(); super.encodeBegin(context); } /* * (non-Javadoc) * * @see javax.faces.component.UIComponentBase#decode(javax.faces.context.FacesContext) */ @Override public void decode(FacesContext context) { super.decode(context); } /* * (non-Javadoc) * * @see javax.faces.component.UIComponentBase#encodeEnd(javax.faces.context.FacesContext) */ @Override public void encodeEnd(FacesContext context) throws IOException { super.encodeEnd(context); ResponseWriter writer = context.getResponseWriter(); try { ScrollDataModel dataModel = (ScrollDataModel) this.getValue(); String clientId = getClientId(context); writer.startElement("div", this); writer.writeAttribute("class", this.getAttributes().get( "scrollPageCss"), null); writer.writeAttribute("name", clientId + "_div", null); writer.writeAttribute("id", clientId + "_div", null); // 当前页 String currentPage = (String) context.getExternalContext() .getRequestParameterMap().get(clientId + "_txt"); writer.startElement("input", this); writer.writeAttribute("name", clientId + "_txt", null); writer.writeAttribute("id", clientId + "_txt", null); writer.writeAttribute("type", "hidden", null); writer.writeAttribute("value", "" + currentPage, null); writer.endElement("input"); // 查询条件 String searchCondition_dynamic = (String) context.getExternalContext() .getRequestParameterMap().get(clientId + "_condition_txt"); writer.startElement("input", this); writer.writeAttribute("name", clientId + "_condition_txt", null); writer.writeAttribute("id", clientId + "_condition_txt", null); writer.writeAttribute("type", "hidden", null); writer.writeAttribute("value", "" + ((searchCondition_dynamic==null||searchCondition_dynamic.trim().length()==0)?"":searchCondition_dynamic), null); writer.endElement("input"); writer.startElement("a", this); writer.writeAttribute("href", "javascript:scrollPage(0)", null); writer.writeText("首页", null); writer.endElement("a"); writer.writeText(" ", null); if (dataModel.getCurrentPage() == 0) { writer.writeText("上一页", null); } else { writer.startElement("a", this); writer.writeAttribute("href", "javascript:scrollPage(" + (dataModel.getCurrentPage() - 1) + ")", null); writer.writeText("上一页", null); writer.endElement("a"); } writer.writeText(" ", null); if (dataModel.getCurrentPage() == ((dataModel.getRowTotalCount() / dataModel .getRowsInPage()))) { writer.writeText("下一页", null); } else { writer.startElement("a", this); writer.writeAttribute("href", "javascript:scrollPage(" + (dataModel.getCurrentPage() + 1) + ")", null); writer.writeText("下一页", null); writer.endElement("a"); } writer.writeText(" ", null); writer.startElement("a", this); writer.writeAttribute("href", "javascript:scrollPage(" + ((dataModel.getRowTotalCount() / dataModel .getRowsInPage())) + ")", null); writer.writeText("末页", null); writer.endElement("a"); writer.writeText(" ", null); writer.startElement("a", this); writer.writeText("共" + dataModel.getRowTotalCount() + "条记录", null); writer.endElement("a"); writer.endElement("div"); writer.startElement("script", this); writer.writeAttribute("language", "javascript", null); writer.writeText("function scrollPage(p){document.getElementById('" + clientId + "_txt').value=p;" + "document.getElementById('" + clientId + "_txt').form.submit();}", null); writer.endElement("script"); } catch (IOException e) { e.printStackTrace(); } } }
2 楼
fourfire
2007-09-17
model层
package com.longtop.core.web.jsf.model; import java.util.ArrayList; import java.util.List; import javax.faces.model.DataModel; public class ScrollDataModel extends DataModel { /** * 总行数 */ private long rowTotalCount; /** * 当前页 */ private int currentPage=0; /** * 每页行数 */ private int rowsInPage=10; private int rowIndex; private List data=new ArrayList(); private String moduleId; private String beanName; private String statementId; private Object queryParam; /** * 接口实现方式 */ private String implType; /** * IBATIS */ public static final String IMPLTYPE_IBATIS="ibatis"; /** * HIBERNATE */ public static final String IMPLTYPE_HIBERNATE="hibernate"; public ScrollDataModel() { super(); } public void loadData() { IScrollDataLoad loader=null; data.clear(); if(this.getImplType().toLowerCase().equals(IMPLTYPE_IBATIS)) { loader=new DefaultScrollDataLoaderIBatisImpl(); }else if(this.getImplType().toLowerCase().equals(IMPLTYPE_HIBERNATE)) { loader=new DefaultScrollDataLoaderHibernateImpl(); } else{ try { loader=(IScrollDataLoad) Class.forName(moduleId).newInstance(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } data.addAll(loader.loadData(moduleId,beanName,statementId, queryParam, currentPage*rowsInPage, rowsInPage)); rowTotalCount=loader.loadDataTotalCount(moduleId,beanName,statementId, queryParam); } /** * @return the currentPage */ public int getCurrentPage() { return currentPage; } /** * @param currentPage * the currentPage to set */ public void setCurrentPage(int currentPage) { this.currentPage = currentPage; } /** * @return the pageCount */ public long getRowTotalCount() { return rowTotalCount; } /** * @param pageCount * the pageCount to set */ public void setRowTotalCount(long rowTotalCount) { this.rowTotalCount = rowTotalCount; } /** * @return the rowsInPage */ public int getRowsInPage() { return rowsInPage; } /** * @param rowsInPage * the rowsInPage to set */ public void setRowsInPage(int rowsInPage) { this.rowsInPage = rowsInPage; } @Override public int getRowCount() { return data.size(); } @Override public Object getRowData() { return data.get(this.getRowIndex()); } @Override public int getRowIndex() { return rowIndex; } @Override public Object getWrappedData() { return data.get(this.getRowIndex()); } @Override public boolean isRowAvailable() { if(this.getRowIndex()<data.size()&&this.getRowIndex()>-1) return true; return false; } @Override public void setRowIndex(int arg0) { rowIndex=arg0; } @Override public void setWrappedData(Object arg0) { data.set(this.getRowIndex(),arg0); } /** * @return the beanName */ public String getBeanName() { return beanName; } /** * @param beanName the beanName to set */ public void setBeanName(String beanName) { this.beanName = beanName; } /** * @return the data */ public List getData() { return data; } /** * @param data the data to set */ public void setData(List data) { this.data = data; } /** * @return the moduleId */ public String getModuleId() { return moduleId; } /** * @param moduleId the moduleId to set */ public void setModuleId(String moduleId) { this.moduleId = moduleId; } /** * @return the queryParam */ public Object getQueryParam() { return queryParam; } /** * @param queryParam the queryParam to set */ public void setQueryParam(Object queryParam) { this.queryParam = queryParam; } /** * @return the statementId */ public String getStatementId() { return statementId; } /** * @param statementId the statementId to set */ public void setStatementId(String statementId) { this.statementId = statementId; } /** * @return the implType */ public String getImplType() { return implType; } /** * @param implType the implType to set */ public void setImplType(String implType) { this.implType = implType; } }
1 楼
fourfire
2007-09-17
数据载入接口
/** * <p>Description:ltCore</p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: LongTop</p> * @author blaze * @version 1.0 */ package com.longtop.core.web.jsf.model; /** * 翻页的数据检索接口,包括获得当前页数据,和获得数据总数两个方法 */ public interface IScrollDataLoad { /** * 获得当前页数据 * * @param moduleId 模块id * @param beanName bean名称 * @param statementId 语句id * @param queryParam * 查询条件 * @param startIndex * 开始行 * @param rowsInPage * 每页行数 * @return */ public java.util.Collection loadData(String moduleId, String beanName, String statementId, Object queryParam, int startIndex, int rowsInPage); /** * 获得数据总行数 * @param moduleId 模块id * @param beanName bean名称 * @param statementId 语句id * @param queryParam查询条件 * @return */ public long loadDataTotalCount(String moduleId, String beanName, String statementId, Object queryParam); }
发表评论
-
play framework log 1
2013-07-23 21:47 15271 背景知识自己学习www.playframework.com ... -
类加载资源路径在不同os下的差别
2010-06-10 12:41 1062java获得类所在的路径的根,出现了不同平台的差异 Syste ... -
findBugs记录
2010-04-07 08:22 18551 在0-n之间取随机数,使用 java.util.Rando ... -
eclipse与360的冲突
2010-04-07 07:38 1987安装360最新版之后,eclipse不能启动。在快捷方式中加入 ... -
eclipse突然不能启动
2010-02-05 09:20 1311eclipse突然不能启动了,提示JVM terminated ... -
hql中怎样在where子句中指定查询的子类
2009-05-14 17:52 1277采用单表存储类的继承关系 A的子类是A1、A2、A3,我想通过 ... -
查找包下所有的类
2009-04-17 11:07 1417包括二级包,classes和jar的情况都考虑 /** ... -
hibernate annotation 定义字段的默认值和显示hql的格式化问题
2008-06-19 10:54 93361 java类中定义属性的默认值并不能直接映射到数据库的定义当 ... -
hibernate annotation提供生成table、column的注释的方法了吗?
2008-06-19 10:42 3910oracle是提供table、column的注释功能的 com ... -
性能方面几点说明
2007-12-13 15:24 10801 获得机器jvm能够使用得最大内存 java -XmxXXX ... -
服务器的一般设置(java)
2007-10-28 12:42 23841 JAVA_OPTS设置java能够使用的内存大小, 一般设 ... -
几个问题
2007-10-17 16:59 11531 用lighttpd做webserver转接到tomcat时 ... -
excel中sheet.cells的参数都是从1开始的
2007-08-27 17:06 3967用jcom获得excel cell的值 xlsApp = ne ... -
equals与hashcode方法的调用
2007-07-13 14:37 1866将对象放在hashset中时 1 ... -
收集正则表达式
2007-06-18 13:46 3761收集一下正则表达式的写法。还望大家补充 匹配中文字符的正则表达 ... -
怎样通过hibernate的annotations生成,创建表结构的sql
2007-06-11 10:32 3241rt 不用生成hbm文件
相关推荐
开发者可以在JSF的视图层中直接绑定JPA实体,实现数据的动态显示和更新。这种方式极大地提高了开发效率,同时保持了代码的整洁和模块化。 总结,JSF和JPA是Java EE环境中构建Web应用的重要工具,它们分别解决了用户...
JSF 提供了多种方式来创建分页UI,例如使用h:commandLink或p:commandButton来表示翻页操作,使用h:outputText或p:outputLabel显示当前页码和总页数。你可以在自定义组件或者现有的JSF库(如PrimeFaces)中找到专门...
在JSF中,我们可以使用各种分页组件来实现这一功能。本文将深入探讨JSF分页组件2的相关知识点,包括其原理、使用方法和最佳实践。 ### 1. 分页组件的基本概念 分页组件允许用户以有限的数量逐页查看数据,而不是一...
本篇文章将深入探讨JSF中的分页组件,以及如何利用它们来实现高效的数据分页。 **1. 分页组件的基本概念** 分页组件通常由两个主要部分组成:分页导航和数据显示区。分页导航包括上一页、下一页、首页和末页等按钮...
在这个简单的例子中,我们关注的是如何在JSF应用中实现数据分页。 **数据分页**是一种在大量数据展示时优化用户体验的技术,它允许用户逐步加载和查看数据,而不是一次性加载所有内容,这可以提高页面加载速度,...
4. **事件处理**:当用户进行翻页操作时,JSF会触发一个动作事件,该事件需要被`ManagedBean`捕获并处理,以更新显示的数据。 5. **分页参数传递**:在URL中或者使用隐式请求参数(例如,通过`f:param`标签)传递...
综上所述,"翻页功能java控件"简化了Java Web开发中的分页处理,通过提供预定义的标签和配置,使得开发者可以快速地在JSP页面上实现翻页功能,提高开发效率。理解并熟练使用这个控件,有助于我们在处理大量数据展示...
在这个“人员管理分页源代码CRUD”项目中,开发者使用JSF来实现一个基本的人力资源管理系统,包括创建(Create),读取(Retrieve),更新(Update)和删除(Delete)功能,并且具备了分页功能,使得数据浏览更加高效。...
提供的文档可能包括Spring Boot官方文档,Spring Data JPA的分页章节,以及如何在Thymeleaf或JSF等视图技术中展示分页信息的示例。这些文档会帮助你更深入地理解和实践分页功能。 9. **最佳实践** - 使用`Page`...
Oracle数据库作为常用的关系型数据库系统,结合JavaServer Faces (JSF) 框架,可以实现高效的分页功能。`MyFaces`是JSF的一个实现,它提供了丰富的组件库来构建Web应用。在这个文档中,我们将探讨如何使用`MyFaces`...
`pager-tablib`库通常与Servlet容器(如Tomcat、Jetty等)以及Java服务器页面(JSP)和JavaServer Faces (JSF)框架一起使用。这个库提供了自定义标签,可以直接在JSP页面上嵌入,通过简单的配置就能实现复杂的分页...
- **Struts2** 则更加灵活,它是基于拦截器的架构,可以更好地与Java EE的标准技术如JSP、JSF等集成。Struts2支持拦截器机制,使得业务逻辑更加清晰。 #### 2. 数据库的用途 数据库主要用于存储、管理和检索数据。...