jsf学习实例
大小:2.33MB
价格:10积分
下载量:0
评分:
5.0
上传者:chenroujie
更新日期:2025-09-22

jsf学习实例

资源文件列表(大概)

文件名
大小
web12/
-
web12/Book.jpg
28.89KB
web12/ConfirmInvoice.jsp
3.67KB
web12/Header.jsp
1.27KB
web12/Home.jsp
1.11KB
web12/index.jsp
185B
web12/ModifyInvoice.jsp
3.38KB
web12/Search.jsp
1.25KB
web12/styles.css
4.7KB
web12/ViewAccounts.jsp
912B
web12/ViewInvoices.jsp
5.11KB
web12/WEB-INF/
-
web12/WEB-INF/faces-config.xml
3.95KB
web12/WEB-INF/web.xml
2.22KB
web12/WEB-INF/classes/
-
web12/WEB-INF/classes/com/
-
web12/WEB-INF/classes/com/wiley/
-
web12/WEB-INF/classes/com/wiley/masteringjsf/
-
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/
-
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/Messages.properties
189B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/Messages_en_US.java
1.03KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/test/
-
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/test/FilterTest.java
1.81KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/test/FilterTest.java.bck
1.81KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/test/Suite.java
453B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/test/Suite.java.bck
453B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/
-
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/InvoiceBean.java
6.44KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/AccountBean.java
2.01KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/HomePage.java
223B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/SearchPage.java
2.14KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/ShowDetailListener.java
1.14KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/ViewInvoicesPage.java
5.07KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/ModifyInvoicePage.java
3.04KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/ViewAccountsPage.java
718B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/ConfirmInvoicePage.java
2.09KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/BooleanTextConverter.java
795B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/InvoiceAppUtils.java
1.79KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/Filter.java
2.53KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/bak/BusinessDelegate.java
2.8KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/AccountBean.class
1.96KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/BooleanTextConverter.class
826B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/BusinessDelegate$DelegateException.class
504B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/BusinessDelegate.class
2.8KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceBean$AmountComparator.class
603B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceBean$DiscountComparator.class
609B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceBean$InvoiceDateComparator.class
612B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceBean$InvoiceNumberComparator.class
627B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceBean.class
5.38KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ConfirmInvoicePage.class
2.04KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/Filter.class
2.61KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/HomePage.class
345B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceAppUtils.class
1.79KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ModifyInvoicePage.class
3.23KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/SearchPage.class
2.01KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ShowDetailListener.class
1.13KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ViewAccountsPage.class
855B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ViewInvoicesPage.class
4.08KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/BooleanTextConverter.java
795B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/BusinessDelegate.java
2.8KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ConfirmInvoicePage.java
2.14KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/Filter.java
2.53KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/HomePage.java
223B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceAppUtils.java
1.79KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/InvoiceBean.java
6.44KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ModifyInvoicePage.java
3.04KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/SearchPage.java
2.14KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ShowDetailListener.java
1.14KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ViewAccountsPage.java
718B
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/ViewInvoicesPage.java
5.07KB
web12/WEB-INF/classes/com/wiley/masteringjsf/ch7ex2/AccountBean.java
2.01KB
web12/WEB-INF/lib/
-
web12/WEB-INF/lib/commons-logging.jar
30.9KB
web12/WEB-INF/lib/jsf-api.jar
355.93KB
web12/WEB-INF/lib/jsf-impl.jar
682.17KB
web12/WEB-INF/lib/commons-beanutils.jar
115.97KB
web12/WEB-INF/lib/commons-collections.jar
166.9KB
web12/WEB-INF/lib/commons-digester.jar
106.57KB
web12/WEB-INF/lib/jstl.jar
20.54KB
web12/WEB-INF/lib/standard.jar
354.97KB
web12/WEB-INF/lib/myfaces-extensions.jar
738.15KB
web12/WEB-INF/lib/commons-fileupload-1.0.jar
21.85KB

资源内容介绍

jsf学习实例 jsf学习实例
package com.wiley.masteringjsf.ch7ex2;import java.io.Serializable;import java.util.*;import javax.faces.model.SelectItem;/** * A bean that models a simple invoice */public class InvoiceBean implements Serializable{ public static final String INVOICE_NUMBER_ID = "invoiceNumberId"; public static final String AMOUNT_ID = "amountId"; public static final String DISCOUNT_ID = "discountId"; public static final String INVOICE_DATE_ID = "invoiceDateId"; private Integer invoiceNumber; private Date invoiceDate; private Double amount;//数量 private AccountBean account; private Double discount;//折扣 private List paymentTerms = new ArrayList();//支付期限 private List statusCodes = new ArrayList(); private String paymentTerm; private Integer statusCode = new Integer(1); private boolean newCustomer; private boolean expedited; // TODO: Not sure this is used in any example... private boolean selected; public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } public InvoiceBean() { } public InvoiceBean(String number, String discount, String amount) { this(new Integer(number), new Date(), new Double(amount), new Double(discount), null); } public InvoiceBean(Integer invoiceNumber, Date invoiceDate, Double amount, Double discount, AccountBean account) { setInvoiceNumber(invoiceNumber); setInvoiceDate(invoiceDate); setDiscount(discount); setAmount(amount); setAccount(account); paymentTerms.add(new SelectItem("0", "Upon Receipt", "")); paymentTerms.add(new SelectItem("30", "Net 30 Days", "")); paymentTerms.add(new SelectItem("60", "Net 60 days", "")); statusCodes.add(new SelectItem(new Integer(1), "Open", "")); statusCodes.add(new SelectItem(new Integer(2), "Past Due", "")); statusCodes.add(new SelectItem(new Integer(3), "Paid", "")); } static class InvoiceNumberComparator implements Comparator { public int compare(Object obj1, Object obj2) { Integer num1 = ((InvoiceBean) obj1).getInvoiceNumber(); Integer num2 = ((InvoiceBean) obj2).getInvoiceNumber(); return num1.compareTo(num2); } } static class AmountComparator implements Comparator { public int compare(Object obj1, Object obj2) { Double num1 = ((InvoiceBean) obj1).getAmount(); Double num2 = ((InvoiceBean) obj2).getAmount(); return num1.compareTo(num2); } } static class DiscountComparator implements Comparator { public int compare(Object obj1, Object obj2) { Double num1 = ((InvoiceBean) obj1).getDiscount(); Double num2 = ((InvoiceBean) obj2).getDiscount(); return num1.compareTo(num2); } } static class InvoiceDateComparator implements Comparator { public int compare(Object obj1, Object obj2) { Date num1 = ((InvoiceBean) obj1).getInvoiceDate(); Date num2 = ((InvoiceBean) obj2).getInvoiceDate(); return num1.compareTo(num2); } } public static Comparator getComparator(String key) { if (key.equals(INVOICE_NUMBER_ID)) return new InvoiceNumberComparator(); if (key.equals(INVOICE_DATE_ID)) return new InvoiceDateComparator(); if (key.equals(AMOUNT_ID)) return new AmountComparator(); if (key.equals(DISCOUNT_ID)) return new DiscountComparator(); throw new IllegalArgumentException("Invalid key " + key); } public String getInvoiceNumberId() { return INVOICE_NUMBER_ID; } public String getAmountId() { return AMOUNT_ID; } protected static String getLabel(List items, Object value) { if (value == null) return null; Iterator itemIter = items.iterator(); while (itemIter.hasNext()) { SelectItem item = (SelectItem) itemIter.next(); if (item.getValue().equals(value)) return item.getLabel(); } throw new IllegalArgumentException("Invalid value: " + value); } public String getSelectedTerm() { return getLabel(paymentTerms, paymentTerm); } public String getSelectedStatus() { return getLabel(statusCodes, statusCode); } public boolean isExpedited() { return expedited; } public void setExpedited(boolean expedited) { this.expedited = expedited; } public boolean isNewCustomer() { return newCustomer; } public void setNewCustomer(boolean newCustomer) { this.newCustomer = newCustomer; } public List getPaymentTerms() { return paymentTerms; } public void setPaymentTerms(List termOptions) { this.paymentTerms = termOptions; } public String getPaymentTerm() {return paymentTerm;} public void setPaymentTerm(String selectedTerm) { this.paymentTerm = selectedTerm; } public List getStatusCodes() {return statusCodes;} public void setStatusCodes(List invoiceStatusOptions) { this.statusCodes = invoiceStatusOptions; } public Integer getStatusCode() { return statusCode; } public void setStatusCode(Integer invoiceStatusCode) { this.statusCode = invoiceStatusCode; } public Integer getInvoiceNumber() { return invoiceNumber; } public void setInvoiceNumber(Integer number) { this.invoiceNumber = number; } public Date getInvoiceDate() { return invoiceDate; } public void setInvoiceDate(Date invoiceDate) { this.invoiceDate = invoiceDate; } public Double getAmount() { return amount; } public void setAmount(Double amount) { this.amount = amount; } public AccountBean getAccount() { return account; } public void setAccount(AccountBean account) { this.account = account; } public Double getDiscount() { return discount; } public void setDiscount(Double discount) { this.discount = discount; }}

用户评论 (0)

发表评论

captcha