[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Cannot introduce getSize(0 method to java.util.Collection

Title: Cannot introduce getSize(0 method to java.util.Collection

I'm trying to get the size of a list in a jsp page:
<c:out value="Number of modules: ${viewableModules.size}"/>

As JSTL uses java bean properties (i.e. size is accessed as getSize()), this doesn't work:

ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V() - Could not complete request
javax.servlet.ServletException: An error occurred while evaluating custom action attribute "value" with value "Number of

 modules: ${viewableModules.size}": The "." operator was supplied with an index value of type "java.lang.String" to be a

pplied to a List or array, but that value cannot be converted to an integer.

I have tried to introduce the method:
public aspect JstlCollectionWrapper {

    public int ArrayList.getSize() {
        return size();

But it still fails with that same error. Can someone explain what might be wrong?



The information contained in this e-mail and attachments, if any, is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not use, copy, distribute or disclose the e-mail and its attachment, or any part of its content or take any action in reliance of it. If you have received this e-mail in error, please e-mail the message back to the sender by replying and then deleting it. We cannot accept responsibility for loss or damage arising from the use of this e-mail or attachments, and recommend that you subject these to your virus checking procedures prior to use