Nicolas
Nicolas

Reputation: 183

Errror - javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property

My application runs under java11 and weblogic14.

Method in jsfHelper class :

public static List<FacesMessage> obtenirMessageGlobal() {
        FacesContext context = FacesContext.getCurrentInstance();
        Iterator<FacesMessage> iter = context.getMessages();
        List<FacesMessage> globalMessages = new ArrayList<FacesMessage>();
        FacesMessage msg;
        // Message global
        while (iter.hasNext()) {
            msg = iter.next();
            if (msg.getSummary() != null
                    && !"".equalsIgnoreCase(msg.getSummary()))
                globalMessages.add(msg);
        }
        // remove specifics messages
        globalMessages.removeAll(obtenirMessageSpecifique());

        return globalMessages;
    }

my jsp file:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:commun="http://xx.xx.xxxx.xxx/commun">
.
.
.
<h:outputText value="#{message}" rendered="#{not empty message}"/>
<a4j:outputPanel id="messages" ajaxRendered="true">
                <h:panelGroup styleClass="globalMessages" layout="block"
                    rendered="#{not empty commun:obtenirMessageGlobal()}" style="border: none; padding: 0px" >
                    <rich:dataList value="#{commun:obtenirMessageGlobal()}" var="message" style="margin-top: 0px; padding-left: 20px"> 
                        <h:graphicImage
                            value="resource:///xx/xx/xxxx/xxx/commun/jsf/skins/dti/images/severity/#{message.severity.ordinal}.gif" />
                        <h:outputText value="#{message.summary}"
                            styleClass="severity#{message.severity.ordinal}" />
                    </rich:dataList>
                </h:panelGroup>
            </a4j:outputPanel>

Here is my exception :

javax.el.PropertyNotFoundException: /WEB-INF/taglib/fragments/uploadPanel.xhtml @37,114 value="resource:///xx/xx/xxxx/xxx/commun/jsf/skins/dti/images/severity/#{message.severity.ordinal}.gif": The class 'java.lang.String' does not have the property 'severity'.

did Anyone know how to resolve this error please?

Update :

Is it possible to add a type attribute type="FacesMessage"? I didn't find someting similar in internet.

Upvotes: 0

Views: 154

Answers (0)

Related Questions