Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [faces-dev] not picking of .size()

 
nevermind  it is all sorted
 
Sent: Wednesday, April 21, 2021 at 8:05 PM
From: "LInda hackkanan" <lindahackkanan@xxxxxxxx>
To: faces-dev@xxxxxxxxxxx
Subject: [faces-dev] not picking of .size()
 
Why am I only getting this ouput  from the xhtml and Java class ?
abc.xhtml -> Xyz.java @Named rvalues and lvalues
The list contains items
 
I am expecting
The list contains 4 items
 
How to best debug these type of issues ?
I am using eclipse IDE with payara 5.X
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
      
<h:head>
<tt> abc.xhtml  -> Xyz.java @Named  rvalues and lvalues</tt>
</h:head>
<h:body>
<ui:debug />
<h:form>
<h:outputText
             value="The list contains #{xzy.list.size()}
                    #{xzy.list.size() == 1 ?
                    'item' : 'items'}" />
</h:form>
</h:body>
</html>
 
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import lombok.Data;
@Named
@SessionScoped
@Data
public class Xyz implements Serializable {
    private static final long serialVersionUID = -8077473693852475564L;
    
    private String[] strArray = {"London", "Paris", "New York", "Barcelona"};
    //initialize an immutable list from array using asList method
     List<String> list = Arrays.asList(strArray);
     
}
 
_______________________________________________ faces-dev mailing list faces-dev@xxxxxxxxxxx To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/faces-dev

Back to the top