JSTL is really much better for this sort of thing. I'd use <c:set var="myId" value="100" /> Because JSTL can make on-the-fly conversions between strings and numbers, I can use this as either a
string or a number. For example:
<c:out value="${myId + 1}" /> renders 101
<c:out value='${"xyz" + myId}' /> renders xyz100
To answer your original question: except for java.lang.String, which is the default type, creating a bean with <bean:Define> only works where the bean has a no-args constructor. java.lang.Integer is an immutable object, and both its constructors require an argument. That's why your code doesn't work.
[ July 14, 2005: Message edited by: Merrill Higginson ]