facebook

Excrescent error property of "" t

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #202918 Reply

    deavil
    Member

    JSP CODE:
    <% int i = 0; %>
    …..
    <jsp:include ….>
    <jsp:param … value=”<%= i %>”/>
    </jsp:include>
    …..

    compiling this code, I got error message:

    “The method setAttribute(String, Object) in the type ServletRequest is not applicable for the arguments (String, int) xxx.jsp”

    Is it an excrescent error property?

    #202920 Reply

    No Operation
    Member

    hm, thinkin:

    the runtime expression must result to a String.

    NOP

    #202929 Reply

    Riyad Kalla
    Member

    As NOP correctly pointed out, the way jsp:includes are handled is to place all the param’s in the request and then process the include which retrieves the params from the request. You cannot place primitive types into the request directly per the definition of the setAttribute method (basically the compiler warning). You CAN wrap this with an Integer, but I realize this may be sub optimal in your case. You would also change to using a <%@include which will do a direct inline, then in your included page just use the i variable. This would create compiler warnings within MyEclipse, but it will work in the servlet container as valid code would be generated from the include. (I had to do this in one instance where it was just too much work/waste of resources to work around it).

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Excrescent error property of "" t

You must be logged in to post in the forum log in