facebook

How does ME help us find errors in JSP pages?

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #205492 Reply

    cfrers
    Member

    Hi Riyad:
    We have observed in our test of ME’s jsp debugging capabilities that if we neglect to import a tag library such as
    <%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean&#8221; prefix=”bean”%>
    and then use for example <bean:write property=”name” name=”loginForm”/>
    we are not alerted by ME that the taglib needs to be included. Why is this? In fact, we can still use code completion
    on the tag <bean:
    We feel that this should not be possible.

    In general, how does ME help us find errors in JSP pages? We do not use scriplets much nor do we look at the generated
    servlet so how can we argue for the business value of JSP debugging as you understand it? Today we use <bean:write a lot to
    check what value our attributes have. Can we use ME in a more intelligent way to get the same information?

    Thanks,
    Claudia

    #205513 Reply

    No Operation
    Member

    This was a former behaviour which was removed by the cause that your example could also be wanted output. There is no way to decide whether it is wanted or an error.

    NOP

    #205514 Reply

    Riyad Kalla
    Member

    Claudia,
    Did NOP’s answer help? I’m not sure I’m clear on your question… are you asking for the value of JSP debugging, or why our JSP editor was not catching the error you pointed out?

    #205517 Reply

    No Operation
    Member

    uhm, oh yes: If you need information about variable values:

    Set a breakpoint and evaluate the variables if the program stops there. Works fine with MyEclipse!

    NOP

    #205521 Reply

    cfrers
    Member

    NOP wrote>There is no way to decide whether it is wanted or an error.

    I disagree. Forgetting to include the taglib is an error an as such we would expect the coloring on an
    attempt to use a bean tag to switch to red to indicate this. We were surprised that instead we were
    offered code completion.

    Riyad wrote>are you asking why our JSP editor was not catching the error you pointed out?
    yes

    #205523 Reply

    No Operation
    Member

    lets regard an (mybe bad) example:

    Let this be the JSP code

    <a:foo>
      <b:bar>
        <c:six/>
      </b:bar>
    </a:foo>
    

    and let assume we just forgot

    <%@ taglib prefix="bar" uri="bar:bar/bar.bar" %>
    

    and the output should be

    <a:foo>
        added by bar"<c:six/>"
    </a:foo>
    

    There is no way to guess that exactly the <b:bar> misses its taglib directive.

    NOP

    #205527 Reply

    Riyad Kalla
    Member

    Claudia,
    I just created the following sample JSP page:

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>My JSP 'MyJsp.jsp' starting page</title>
      </head>
      <body>
          <bean:write name="bob" property="name" />
      </body>
    </html>
    

    And was able to reproduce the lack of an error. I agree with you, this should be marked as an error, however I think NOP’s point is that there is no way for us to know that bean:write is infact not a valid tag. I’m curious if we can key off of the colon to tell if its a taglib or not, and then look for the appropriate taglib entry in the file, to know if we should mark an error or not.

    Let me send this request to Scott/Michael and see what they think. Thank you for your report and fine attention to detail!

    #205538 Reply

    support-michael
    Keymaster

    We originally incorporated the behavior of marking tags without a taglib directive as errors. We then discovered through user feedback (complaints) that this assumption did not allow for non-JSP custom tags which the JSP spec. says should be ignored. Thus the situation you describe is really ambiguous. Is <bean:xxx> a custom non-JSP tag which should be ignored or is it a JSP tag?

    Like the Eclipse platform team we are learning that there is not a single use-model that we can optimize ME towards. But rather ME policies and behaviors need to be much more customizable. In this case would it make sense to have a user preference to treat custom tags w/o a @taglib directive as an error?

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: How does ME help us find errors in JSP pages?

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