icefaces(JSF)中的message不显示

stenlylee 2008-04-12 12:17:37
如下代码:
页面

<ice:inputText id="userName" required="true" />
<ice:message for="userName" />


backing bean

FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.addMessage("userName", new FacesMessage(FacesMessage.SEVERITY_ERROR, "测试", ""));


页面上message显示不出来,console里面有打印出正确的message

把addMessage的"userName"换成null,也就是将文本框的消息编程全局消息,页面上的messages就能够正确显示

文本框的required消息能够正常显示,ice:message换成h:message一样的问题

有谁知道是什么问题么?到底是icefaces的问题还是JSF的问题?如果解决?
...全文
141 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiangyang336 2008-06-25
  • 打赏
  • 举报
回复
我遇到这种问题
在后台要这样写:
FacesContext.getCurrentInstance().addMessage("form:userid",
new FacesMessage("Invalid Login!"));

其中:
<h:form id="form">
<h:message for="userid" errorClass="ValidateError"/>

要通过from 中的id再去查找message
stenlylee 2008-04-17
  • 打赏
  • 举报
回复
现在整个对csdn失望了,不知道是整体水平太大众化了,还是由于微软的赞助太多了,让整个网站偏重到商业的上面了,同样的问题发到其他几个论坛,都有回复了,我自己也找出问题答案了。算了,放弃csdn了
Title: Java EE 7 Development with NetBeans 8 Author: David R. Heffelfinger Length: 362 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-01-30 ISBN-10: 1783983523 ISBN-13: 9781783983520 Develop professional enterprise Java EE applications quickly and easily with this popular IDE About This Book Use the features of the popular NetBeans IDE to accelerate your development of Java EE applications Covers the latest versions of the major Java EE APIs such as JSF 2.2, EJB 3.2, JPA 2.1, CDI 1.1, and JAX-RS 2.0 Walks you through the development of applications utilizing popular JSF component libraries such as PrimeFaces, RichFaces, and ICEfaces Who This Book Is For The book is aimed at Java developers who wish to develop Java EE applications while taking advantage of NetBeans functionality to automate repetitive tasks. Familiarity with NetBeans or Java EE is not assumed. In Detail NetBeans has several features that greatly simplify Java EE development, but with many features and great flexibility, Java developers can become overwhelmed by the options available in NetBeans. Java EE 7 Development with NetBeans 8 takes you through the most important parts of Java EE programming and shows you how to use the features of NetBeans that will improve your development experience through clear, careful instructions and screenshots. This book will take you through the major Java EE APIs and how to get them working in the NetBeans environment. This is a practical guide that covers how to leverage NetBeans 8 functionality to quickly and easily develop enterprise applications compliant with the Java EE 7 standard. Table of Contents Chapter 1: Getting Started with NetBeans Chapter 2: Developing Web Applications using JavaServer Faces 2.2 Chapter 3: JSF Component Libraries Chapter 4: Interacting with Databases through the Java Persistence API Chapter 5: Implementing the Business Tier with Session Beans Chapter 6: Contexts and Dependency Injection Chapter 7: Messaging with JMS and Message-driven Beans Chapter 8: Java API for JSON Processing Chapter 9: Java API for WebSocket Chapter 10: RESTful Web Services with JAX-RS Chapter 11: SOAP Web Services with JAX-WS

67,515

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧