Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354347 - Multiple validation warnings for EL in JSP tag file
Summary: Multiple validation warnings for EL in JSP tag file
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 3.3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 05:18 EDT by Victor Homyakov CLA
Modified: 2011-11-04 05:39 EDT (History)
2 users (show)

See Also:
nsand.dev: review+


Attachments
proposed patch (6.68 KB, patch)
2011-10-17 11:00 EDT, Nitin Dahyabhai CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Homyakov CLA 2011-08-10 05:18:12 EDT
Build Identifier: 20110615-0604

EL expression in JSP tag file (WEB-INF/tags/*.tag) produce multiple validation warnings.

Reproducible: Always

Steps to Reproduce:
1. Create Web Project.
2. Create new JSP tag file btn.tag in WEB-INF/tags/ folder with following content:

<%@tag body-content="empty" language="java" pageEncoding="UTF-8" isELIgnored="false"%>
<%@attribute name="disabled" required="false" rtexprvalue="true" description="true for disabled button."%>
<input type="button" ${disabled? 'disabled="disabled"':''} />

3. Validation of tag will produce 5 warnings for EL expression:
- Invalid location of text (${) in tag (<input>).
- Invalid location of text (? ') in tag (<input>).
- Undefined attribute name (:).
- Invalid location of text (''}) in tag (<input>).
- Invalid location of text (') in tag (<input>).
Comment 1 Nitin Dahyabhai CLA 2011-10-17 10:25:35 EDT
Looks like the JSP parser isn't recognizing the EL in the tag itself.
Comment 2 Nitin Dahyabhai CLA 2011-10-17 11:00:23 EDT
Created attachment 205340 [details]
proposed patch
Comment 3 Nick Sandonato CLA 2011-10-17 14:54:54 EDT
Looks good to me.
Comment 4 Nick Sandonato CLA 2011-10-19 16:03:24 EDT
Code released to 3_3_Maintenance and HEAD.
Comment 5 Nick Sandonato CLA 2011-10-19 16:04:47 EDT
.
Comment 6 Victor Homyakov CLA 2011-11-03 06:35:40 EDT
(In reply to comment #4)
> Code released to 3_3_Maintenance and HEAD.

Downloaded wtp-M-3.3.2-20111026220513.zip and installed into Eclipse. Multiple warnings are disappeared, but single error with HUGE description is raised instead:

Encountered "<EOF>" at line 1, column 12.
Was expecting one of:
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <STRING_LITERAL> ...
    "true" ...
    "false" ...
    "null" ...
    "(" ...
    "-" ...
    "not" ...
    "!" ...
    "empty" ...
    <IDENTIFIER> ...
    "not" ...
    "!" ...
    "-" ...
    "empty" ...
    "true" ...
    "false" ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <STRING_LITERAL> ...
    "null" ...
    "(" ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...
    <IDENTIFIER> ...

JSP example:

<input type="text" ${disabled == 'true' ? 'disabled="disabled"' : ''} />

(fragment "= '" in EL expression is marked with red line).

Should I reopen this ticket or create a new one?
Comment 7 Nick Sandonato CLA 2011-11-03 10:49:29 EDT
Thanks for verifying, Victor. Please open a new defect. The problems are fundamentally different.
Comment 8 Victor Homyakov CLA 2011-11-04 05:39:57 EDT
(In reply to comment #7)
> Please open a new defect.
Opened bug 362878. Please look - maybe I've forgot something.