U
Usenet Poster!!!
I'm extending an ArrayList and adding my own property.
However, when I use JSP 2.0 and JSTL it can't seem to be able to
access the property, it keeps trying to coerce the name into an
Integer.
Example:
public class Foo extends ArrayList {
private String x = null;
public Foo() {
super();
}
public String getX() {
return x;
}
public void setX(String x) {
this.x = x;
}
}
My JSP goes something like this:
.....
<jsp:useBean id="foo" class="Foo"/>
<c:set var="c" value="${foo.x}"/>
.....
It complains that it can't convert x into an integer the error message
from Tomcat 5 is below:
javax.servlet.ServletException: The "." operator was supplied with an
index value of type "java.lang.String" to be applied to a List or
array, but that value cannot be converted to an integer.
Root cause
javax.servlet.jsp.el.ELException: The "." operator was supplied with
an index value of type "java.lang.String" to be applied to a List or
array, but that value cannot be converted to an integer.
So is this a "feature" that I can work around?
However, when I use JSP 2.0 and JSTL it can't seem to be able to
access the property, it keeps trying to coerce the name into an
Integer.
Example:
public class Foo extends ArrayList {
private String x = null;
public Foo() {
super();
}
public String getX() {
return x;
}
public void setX(String x) {
this.x = x;
}
}
My JSP goes something like this:
.....
<jsp:useBean id="foo" class="Foo"/>
<c:set var="c" value="${foo.x}"/>
.....
It complains that it can't convert x into an integer the error message
from Tomcat 5 is below:
javax.servlet.ServletException: The "." operator was supplied with an
index value of type "java.lang.String" to be applied to a List or
array, but that value cannot be converted to an integer.
Root cause
javax.servlet.jsp.el.ELException: The "." operator was supplied with
an index value of type "java.lang.String" to be applied to a List or
array, but that value cannot be converted to an integer.
So is this a "feature" that I can work around?