facebook

Object not recognized when JSP expression used in attribute

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

    Steve Bang
    Member

    When a custom tag uses only attribute values and does not include run-time expression values, objects defined in the custom tag can be scripted to just fine. But, when a JSP expression is included in a tag attribute’s value, the object cannot be resolved. This is a common practice for our customers and field engineers.

    Code with comments below.

    Steve

    ===========================================

    <%@ page contentType=”text/html;charset=UTF-8″ %>

    <%@ taglib uri=”bloxtld” prefix=”blox”%>

    <%
    String query = “select from [sales]”;

    %>

    <blox:present
    id=”queryWithoutExpressionPB”
    visible=”false”>
    <blox:chart visible=”false” />
    <blox:grid defaultCellFormat=”$#,###,###.00;[red]($#,###,###.00)”/>
    <blox:data dataSourceName=”foodmart” query = “select from sales” />
    </blox:present>

    // the object below is resolved just fine
    <%
    queryWithoutExpressionPB.getPageBlox();
    %>

    <blox:present
    id=”queryWithExpressionPB”
    visible=”false”>
    <blox:chart visible=”false” />
    <blox:grid defaultCellFormat=”$#,###,###.00;[red]($#,###,###.00)”/>
    <blox:data dataSourceName=”foodmart” query = “<%= query %>” />
    </blox:present>

    // the one below doesn’t work if there is a Java expression
    //in the query tag (remove the Java expression & replace
    // with the string – it then works
    <%

    queryWithExpressionPB.

    %>

    #204560 Reply

    No Operation
    Member

    where can I download that taglib?

    NOP

    #204594 Reply

    Steve Bang
    Member

    It’s our company’s proprietary taglib for creating interactive interfaces for use with multidimensional and relational data sources. Multidimensional data sources, if you don’t know, are primarily used by financial analysts and business managers for drilling into aggregated data and are typically return data much faster than relational queries. The major multidimensional data sources Alphablox supports include Hyperion Essbase and Microsoft Analysis Services.

    The problem should be reproducible with other tag libraries. And, the above example works fine in IntelliJ,correctly resolving the objects.

    Steve

    #204605 Reply

    Riyad Kalla
    Member

    Steve,
    This is odd, I have fired this off to Scott/Michael to see what they find and in parallel imagine NOP won’t sleep until he can figure out what is going on 😉

    Just wanted to update you to let you know we are on it.

    #204616 Reply

    No Operation
    Member
    #204624 Reply

    Steve Bang
    Member

    I can’t tell that it is. But, interestingly, if I collapse the JSP scriptlet to a single line, the debugging error moves to the line with the closing tag of the PresentBlox (</blox:present>). The same error (queryWithExpressionPB.out cannot be resolved or is not a field) occurs either way, but it points to a different location.

    Below is the snippet showing the change:

    <blox:present
    id=”queryWithExpressionPB”
    visible=”false”>
    <blox:chart visible=”false” />
    <blox:grid defaultCellFormat=”$#,###,###.00;[red]($#,###,###.00)”/>
    <blox:data dataSourceName=”foodmart” query = “<%= query %>” />
    </blox:present>

    // the one below doesn’t work if there is a Java expression in the query tag
    // (remove the Java expression & replace with the string – it then works

    <% queryWithExpressionPB. %>

    Does that help? If you think the fix for the other bug is related, you could send me a build with that fix and I’ll test it.

    Steve

    #204625 Reply

    Riyad Kalla
    Member

    Steve,
    Do you have EL enabled for this app? Can you insert the value of query using an EL statement instead of a scriplet? I wonder if that works (this is odd indeed)

    #204628 Reply

    Steve Bang
    Member

    No it’s not enabled and won’t run in a 2.0 container, but perhaps I can come up with another test case later. I imagine it will be easy to reproduce with JSF components, since we’re a lot alike.

    Steve

    #204656 Reply

    No Operation
    Member

    I tried similar code:

    
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <bean:define id="queryWithoutExpressionPB" type="java.lang.String" value="a" />
    <%
      queryWithoutExpressionPB.toUpperCase();
    %>
    
    <bean:define id="queryWithExpressionPB" type="java.lang.String" value='<%= "b" %>' />
    <%
      queryWithExpressionPB.
    %>
    

    and it works as it should…

    NOP

    #204674 Reply

    Riyad Kalla
    Member

    Steve,
    Can you confirm the example code that NOP just posted works in your installation of MyEclipse? If it does, then I think there may be some issue with the taglib… if it doesn’t work, then we can troubleshoot an installation problem.

    #204748 Reply

    Steve Bang
    Member

    I can try this later tonight or tomorrow. Or, is there an email address that I can send the relevant files (JAR and TLD)? I don’t think it’s a taglib issue, since it works fine in IntelliJ. But, it’s possible.

    Steve

    #204763 Reply

    Steve Bang
    Member

    NOP’s code example exhibited the same behavior as mine. I assume that NOP has a more recent build than mine and the problem is fixed there. 🙂

    Steve

    #204768 Reply

    Riyad Kalla
    Member

    Steve,
    Are you using MyEclipse 2.7 GA? You can check from the Help->About page and click the MyEclipse icon.

    #204771 Reply

    Steve Bang
    Member

    Sorry, I thought I had said earlier that I am using 3.7 RC2, but it looks like I forgot to mention it. What was NOP testing?

    Steve

    #204773 Reply

    Riyad Kalla
    Member

    Steve,
    It is possible that NOP is testing the 3.7 GA release internally that hasn’t been released quite yet. What we can do from this point is:
    1) have you test your project using Eclipse 2.1.2 and MyEclipse 2.7 GA
    OR
    2) wait until 3.7 GA is released (next week possibly) and wait until that time to try and see if your problem still exists.

    Do these approaches sound reasonable to you?

Viewing 15 posts - 1 through 15 (of 25 total)
Reply To: Object not recognized when JSP expression used in attribute

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