当前位置: 首页 > news >正文

旅游网站建设系统北京网页制作

旅游网站建设系统,北京网页制作,网站登记查询,营销型网站有哪些特点jsf服务在大型软件开发项目中#xff0c;面向服务的体系结构非常常见#xff0c;因为它提供了可供不同团队或部门使用的功能接口。 创建用户界面时#xff0c;应应用相同的原理。 对于具有开票部门和客户管理部门等的大型公司#xff0c;组织结构图可能如下所示#xff1a… jsf服务 在大型软件开发项目中面向服务的体系结构非常常见因为它提供了可供不同团队或部门使用的功能接口。 创建用户界面时应应用相同的原理。 对于具有开票部门和客户管理部门等的大型公司组织结构图可能如下所示 如果计费部门要开发一个用于创建发票的新对话框则可能如下所示 如您所见上面的屏幕在上部引用了一个客户。 单击短名称文本字段后面的“ ..”按钮将打开以下对话框允许用户选择客户 按“选择”后客户数据将显示在发票表格中。 也可以通过简单地输入客户编号或在发票屏幕上的文本字段中输入简称来选择客户。 如果输入了唯一的短名称则根本不会出现选择对话框。 而是直接显示客户数据。 只有不明确的简称会导致打开客户选择屏幕。 客户功能将由属于客户管理团队的开发人员提供。 一种典型的方法是由客户管理开发团队提供一些服务而计费部门的开发人员创建用户界面并调用这些服务。 但是这种方法需要在这两个不同部门之间建立更强的耦合而不是实际需要的耦合。 发票只需要一个唯一的ID即可引用客户数据。 创建发票对话框的开发人员实际上并不想知道如何查询客户数据或在后台使用哪些服务来获取该信息。 客户管理开发人员应提供UI的完整部分以显示客户ID并处理客户的选择 使用JSF 2使用复合组件很容易实现。 客户管理部门和计费部门之间的逻辑接口包括三个部分 复合组件XHTML 复合组件的支持bean 侦听器界面用于处理选择结果 提供者客户管理部门 复合组件 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlnshttp://www.w3.org/1999/xhtmlxmlns:uihttp://java.sun.com/jsf/faceletsxmlns:hhttp://java.sun.com/jsf/htmlxmlns:fhttp://java.sun.com/jsf/corexmlns:compositehttp://java.sun.com/jsf/compositexmlns:icehttp://www.icesoft.com/icefaces/componentxmlns:acehttp://www.icefaces.org/icefaces/componentsxmlns:icecorehttp://www.icefaces.org/icefaces/coreui:compositioncomposite:interface namecustomerSelectionPanel displayNameCustomer Selection Panel shortDescriptionSelect a customer using its number or short namecomposite:attribute namemodel typeorg.fuin.examples.soui.view.CustomerSelectionBean requiredtrue / /composite:interfacecomposite:implementationui:param namemodel value#{cc.attrs.model}/ice:form idcustomerSelectionFormicecore:singleSubmit submitOnBlurtrue /h:panelGroup idtable layoutblocktabletrtdh:outputLabel forcustomerNumbervalue#{messages.customerNumber} //tdtdh:inputText idcustomerNumbervalue#{model.id} requiredfalse //tdtdnbsp;/tdtdh:outputLabel forcustomerShortNamevalue#{messages.customerShortName} //tdtdh:inputText idcustomerShortNamevalue#{model.shortName} requiredfalse //tdtdh:commandButton action#{model.select}value#{messages.select} //td/trtrtdh:outputLabel forcustomerNamevalue#{messages.customerName} //tdtd colspan5h:inputText idcustomerNamevalue#{model.name} readonlytrue //td/tr/table/h:panelGroup/ice:form/composite:implementation/ui:composition/html 复合组件的后备bean package org.fuin.examples.soui.view;import java.io.Serializable;import javax.enterprise.context.Dependent; import javax.inject.Inject; import javax.inject.Named;import org.apache.commons.lang.ObjectUtils; import org.fuin.examples.soui.model.Customer; import org.fuin.examples.soui.services.CustomerService; import org.fuin.examples.soui.services.CustomerShortNameNotUniqueException; import org.fuin.examples.soui.services.UnknownCustomerException;Named Dependent public class CustomerSelectionBean implements Serializable {private static final long serialVersionUID 1L;private Long id;private String shortName;private String name;private CustomerSelectionListener listener;Injectprivate CustomerService service;public CustomerSelectionBean() {super();listener new DefaultCustomerSelectionListener();}public Long getId() {return id;}public void setId(final Long id) {if (ObjectUtils.equals(this.id, id)) {return;}if (id null) {clear();} else {clear();this.id id;try {final Customer customer service.findById(this.id);changed(customer);} catch (final UnknownCustomerException ex) {FacesUtils.addErrorMessage(ex.getMessage());}}}public String getShortName() {return shortName;}public void setShortName(final String shortNameX) {final String shortName (shortNameX ) ? null : shortNameX;if (ObjectUtils.equals(this.shortName, shortName)) {return;}if (shortName null) {clear();} else {if (this.id ! null) {clear();}this.shortName shortName;try {final Customer customer service.findByShortName(this.shortName);changed(customer);} catch (final CustomerShortNameNotUniqueException ex) {select();} catch (final UnknownCustomerException ex) {FacesUtils.addErrorMessage(ex.getMessage());}}}public String getName() {return name;}public CustomerSelectionListener getConnector() {return listener;}public void select() {// TODO Implement...}public void clear() {changed(null);}private void changed(final Customer customer) {if (customer null) {this.id null;this.shortName null;this.name null;listener.customerChanged(null, null);} else {this.id customer.getId();this.shortName customer.getShortName();this.name customer.getName();listener.customerChanged(this.id, this.name);}}public void setListener(final CustomerSelectionListener listener) {if (listener null) {this.listener new DefaultCustomerSelectionListener();} else {this.listener listener;}}public void setCustomerId(final Long id) throws UnknownCustomerException {clear();if (id ! null) {clear();this.id id;changed(service.findById(this.id));}}private static final class DefaultCustomerSelectionListener implementsCustomerSelectionListener {Overridepublic final void customerChanged(final Long id, final String name) {// Do nothing...}}} 用于处理结果的侦听器接口 package org.fuin.examples.soui.view;/*** Gets informed if customer selection changed.*/ public interface CustomerSelectionListener {/*** Customer selection changed.** param id New unique customer identifier - May be NULL.* param name New customer name - May be NULL.*/public void customerChanged(Long id, String name);} 用户计费部门 发票Bean只是通过注入来使用客户选择Bean并使用侦听器接口连接到它 package org.fuin.examples.soui.view;import java.io.Serializable;import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; import javax.enterprise.inject.New; import javax.inject.Inject; import javax.inject.Named;Named(invoiceBean) SessionScoped public class InvoiceBean implements Serializable {private static final long serialVersionUID 1L;Inject Newprivate CustomerSelectionBean customerSelectionBean;private Long customerId;private String customerName;PostConstructpublic void init() {customerSelectionBean.setListener(new CustomerSelectionListener() {Overridepublic final void customerChanged(final Long id, final String name) {customerId id;customerName name;}});}public CustomerSelectionBean getCustomerSelectionBean() {return customerSelectionBean;}public String getCustomerName() {return customerName;}} 最后在发票XHTML中使用了复合组件并将其链接到注入的支持bean !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlnshttp://www.w3.org/1999/xhtmlxmlns:uihttp://java.sun.com/jsf/faceletsxmlns:hhttp://java.sun.com/jsf/htmlxmlns:fhttp://java.sun.com/jsf/corexmlns:fuinhttp://fuin.org/examples/soui/faceletsxmlns:customerhttp://java.sun.com/jsf/composite/customerui:composition template/WEB-INF/templates/template.xhtmlui:param nametitle value#{messages.invoiceTitle} /ui:define nameheader/ui:defineui:define namecontentcustomer:selection-panel model#{invoiceBean.customerSelectionBean} //ui:defineui:define namefooter/ui:define/ui:composition/html 摘要 总之用户界面中引用其他部门数据的部分应由提供数据的部门负责。 然后可以很容易地对提供的代码进行任何更改而无需对使用代码进行任何更改。 此方法的另一个重要好处是协调应用程序的用户界面。 显示相同数据的控件和面板始终看起来相同。 每个部门还可以为其提供的用户界面组件创建一个存储库从而使设计新对话框的过程像将正确的组件放在一起一样容易。 参考 A Java Developers Life博客上的JCG合作伙伴 Michael Schnell提供的面向服务的UI 。 翻译自: https://www.javacodegeeks.com/2012/09/service-oriented-ui-with-jsf.htmljsf服务
http://www.zqtcl.cn/news/850763/

相关文章:

  • 免费网上商城网站建设廊坊十大名牌模板厂
  • 网站建设格式龙泉建设工程有限公司网站
  • 四海网络网站建设咨询深圳网站优化网站
  • 报名网站开发多钱做酒网站
  • 2014年网站设计趋势怎样用代码建设一个网站
  • 手机网站使用微信支付瑞诺国际公司团队介绍
  • 如何做网站内容架构分析网站建站平台eazyshop
  • 网站开发 商标第几类建站模板大全
  • 找事做的网站杭州网站建设有限公司
  • 临沂网站建设搭建短视频如何引流与推广
  • 网站项目建设管理简介网络营销的概念
  • 网站后台怎么添加代码食品网站开发的背景
  • 茶楼 网站dedecms 旅游网站模板
  • 物流网站做那个好凯里网站设计
  • 网站 方案网页设计尺寸用怎么量
  • 商城购物网站设计内容互联网公司网站建设费用
  • 做租号玩网站赚钱吗网站下的源代码和自己做的区别
  • 关于校园网站的策划书久久建筑网的账号
  • 网站宣传的方式怎么查看一个网站有没有做推广
  • 台州房产网站建设自助开通网站
  • 佛山正规网站建设报价二级域名需要申请吗
  • 网站用户体验比较论坛类网站可以做移动端吗
  • 佛山网站优化建设网站设计公司种类
  • 永嘉高端网站建设效果空间设计手法有哪些
  • 好模板网站盐城做网站价格
  • 农村自建房设计图 效果图常州百度推广优化
  • 北京便宜网站建设为什么自己做的网站别的电脑打不开
  • 濮阳网站建设哪里便宜html页面模板
  • 个人推广网站wordpress 交友模板
  • 新乡网站建设价格中国反钓鱼网站联盟