Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Issue while using EL  RSS feed

 
udit agarwal
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am facing issues using EL to do some arithmetic on the JSP ie.

I have a 2 objects having some int fields.

I set it in the request and on the Jsp page i write down the following code

<c:if test="${ empty ( object1['int1'] + object2['int1'] ) }" >
//do something
</c:if>

Some times it works and sometime it show error -
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.

I also tried it with the dot operator i.e

<c:if test="${ empty ( object1,int1 + object2,int1 ) }" >
//do something
</c:if>

but still getting the same issue. Some times it works.

I m wondering why it is behaving like this....
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what does the getInt1 method of your object return?

An int? A String?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!