Bonjour,

J'ai un petit soucis, je n'arrive pas à l'aide du tag c:when à accéder à la taille d'un Vector se trouvant dans un JavaBean.

Donc j'ai un JavaBean (version courte)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package beans;
 
import org.apache.log4j.Logger;
 
import java.util.Vector;
 
/**
 * Created by IntelliJ IDEA.
 * User: delcrst
 * Date: 12-juin-2006
 * Time: 11:35:52
 * To change this template use File | Settings | File Templates.
 */
public class WelcomeBean implements java.io.Serializable{
 
private Vector callInstrumentInfo;
    Logger log = Logger.getLogger(WelcomeBean.class.getName());
 
 public WelcomeBean()
    {}
 
public Vector getCallInstrumentInfo() {
        return callInstrumentInfo;
    }
 
    public void setCallInstrumentInfo(Vector callInstrumentInfo) {
        this.callInstrumentInfo = callInstrumentInfo;
        if(callInstrumentInfo.size() > 1)
        {
            setCallCode((String)callInstrumentInfo.elementAt(1));
            setInstrumentId(((Integer)callInstrumentInfo.elementAt(0)).intValue());
            if(((Integer)callInstrumentInfo.get(2)).intValue() == 1)
            {
                setSingle(true);
            }
            if(((Integer)callInstrumentInfo.get(3)).intValue() == 1)
            {
                setOnlineOnly(true);
            }
            if(((Integer)callInstrumentInfo.get(4)).intValue() == 1)
            {
                setMobCall(true);
                log.info("The call {"+getCallId()+"} is a Mobility Call");
            }
        }
    }
 
 
}
Ensuite voici le bout de code que j'utilise dans ma jsp

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
 
<c:choose>
                <%log.info("Call instrument Info size = "+welcomeBean.getCallInstrumentInfo().size());%>
                    <c:when test="${welcomeBean.['callInstrumentInfo'].['size'] > 1}">
 
...............
..............
.................
Le test dans la balise c:when ne fonctionne pas. Il me retourne un ClassCastException.

Existe-t-il une manière de tester la taille d'un Vector se trouvant dans un JavaBean sans utiliser de scriplet

d'avance pour vos réponses