要在jsf中使用丰富的通知消息而需要添加的jar? [英] jars required to be added to use rich notify messages in jsf?

查看:58
本文介绍了要在jsf中使用丰富的通知消息而需要添加的jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用丰富的通知消息,并添加了所有相关的jar,即
richfaces-components-ui-4.1.0.Final
richfaces-core-impl-4.0.0.Final
standard-1.1.2
jstl-1.2
validation-api-1.0.0.GA
richfaces-core-api-4.0.0.Final
richfaces-components-api-4.0.0.Final
jsf-impl-2.0.2
cssparser-0.9.5
guava-r08
jhighlight-1.0.
但是我却找不到类异常:org.richfaces.component.NotifyAttributes.

i am using rich notify messages and added all related jars namely
richfaces-components-ui-4.1.0.Final ,
richfaces-core-impl-4.0.0.Final,
standard-1.1.2 ,
jstl-1.2 ,
validation-api-1.0.0.GA ,
richfaces-core-api-4.0.0.Final ,
richfaces-components-api-4.0.0.Final
jsf-impl-2.0.2,
cssparser-0.9.5,
guava-r08,
jhighlight-1.0.
but i am getting class not found exception:org.richfaces.component.NotifyAttributes.

sample.xhtml:

sample.xhtml:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:a4j="http://richfaces.org/a4j"
        xmlns:rich="http://richfaces.org/rich">
        <rich:panel>
            <f:facet name="header">
                <h:outputText value="Validation Form" />
            </f:facet>
            <h:form>
                <h:panelGrid columns="3">
                    <rich:validator event="change">
                        <h:outputText value="Name:" />
                        <h:inputText label="Name" id="name" value="#{userBean.name}"
                            required="true">
                            <f:validateLength minimum="3" />
                        </h:inputText>
                        <rich:message for="name" ajaxRendered="true" />
                        <h:outputText value="Job:" />
                        <h:inputText label="Job" id="job" value="#{userBean.job}"
                            requiredMessage="Job is required">
                            <f:validateLength minimum="3" maximum="50" />
                        </h:inputText>
                        <rich:message for="job" ajaxRendered="true" />
                        <h:outputText value="Address:" />
                        <h:inputText label="Address" id="address"
                            value="#{userBean.address}" requiredMessage="Address is required">
                            <f:validateLength minimum="10" />
                        </h:inputText>
                        <rich:message for="address" ajaxRendered="true" />
                        <h:outputText value="Zip:" />
                        <h:inputText label="Zip" id="zip" value="#{userBean.zip}"
                            requiredMessage="Zip is required">
                            <f:validateLength minimum="4" maximum="9" />
                        </h:inputText>
                        <rich:message for="zip" ajaxRendered="true" />
                    </rich:validator>
                    <rich:notifyMessages stayTime="2000" nonblocking="true" escape="false"/>
                    <f:facet name="footer">
                        <a4j:commandButton value="Ajax Validate" />
                    </f:facet>
                </h:panelGrid>
            </h:form>
        </rich:panel>
    </ui:composition>

 bean class used to set and get bean vlaues.let me know whats wrong with existing code ,along with jars to be added   
    userBean.java:

    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;

    @ManagedBean
    @SessionScoped
    public class userBean {
        private String name;
        private String job;
        private String address;
        private String zip;
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getJob() {
            return job;
        }
        public void setJob(String job) {
            this.job = job;
        }
        public String getAddress() {
            return address;
        }
        public void setAddress(String address) {
            this.address = address;
        }
        public String getZip() {
            return zip;
        }
        public void setZip(String zip) {
            this.zip = zip;
        }

    }



 error:
    Caused by: java.lang.ClassNotFoundException: org.richfaces.component.NotifyAttributes

尽管我添加了所有必需的jar of richfaces4.0及更高版本,但我仍然不明白为什么会这样.

i am not getting why this is getting although i added all required jars of richfaces4.0 and above.

推荐答案

notify 组件不是RichFaces 4.0的一部分.请参见 Richfaces 4.0 VDL文档.您必须使用4.1或更高版本(例如当前版本的RichFaces 4.3).
注意:所有richfaces-???.jar都应与同一版本的RichFaces一起使用.

notify component is not part of RichFaces 4.0. See Richfaces 4.0 VDL documentation. You have to use version 4.1 or up (for example current version RichFaces 4.3).
Note: all richfaces-???.jar(s) should be for the same version of RichFaces.

这篇关于要在jsf中使用丰富的通知消息而需要添加的jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆