Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 105875

Summary: Incorrect "Undefined Attribute" Warning in JSP Editor
Product: [WebTools] WTP Source Editing Reporter: Carsten Friedrich <carsten>
Component: jst.jspAssignee: Nitin Dahyabhai <thatnitind>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, for.work.things, mauromol, rkalla, thatnitind
Version: 0.7   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Project to test the problem with none

Description Carsten Friedrich CLA 2005-08-02 19:39:19 EDT
I have the following code in a .jsp file:

[...]
		<FORM action="" method="post">

		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td width="34" class="FormFieldDesc">
				<div align="right">Fund&nbsp;</div>
				</td>
				<td width="20"><select name="fund">
					<%String error= "";

						for (int i= 0; i < funds.length; i++) {
							FundVO fund= funds[i];

							%>
					<option
						<%= (fund.getFundName().equals(fundStr) ? "SELECTED" :
"")%>><%=fund.getFundName()%>
[...]

The last line give a "Undefined attribute <%=
(fund.getFundName().equals(fundStr) ? "SELECTED" :
"")%>><%=fund.getFundName()%>" warning which is not correct
Comment 1 David Williams CLA 2005-08-04 11:29:41 EDT
Amy, will you please triage these to determine proper owner (if you can't fix,
that is). 
Comment 2 Amy Wu CLA 2005-10-31 15:35:23 EST
Phil, I think you may be more familiar with this than I.
Comment 3 David Williams CLA 2006-03-28 03:24:08 EST
Mass transfer from pa to dw. Needs more triage. 
Comment 4 Mauro Molinari CLA 2006-07-17 12:10:16 EDT
I would like to report other two little examples where the JSP editor gives this kind of warning:

---
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Test</title>
</head>
<body>
<%
  final boolean pippo = true;
%>
<form>
  <input type="checkbox" <%=pippo? "checked":"" %> >
  <input type="checkbox" <%if(pippo){%>checked<%}%>>
</form>
</body>
</html>
---

The two rows with "<input type... etc.>" generate the warnings.
I noticed that no warning is given if the scriptlets are not within the definition of a tag (like "<input type...>").

I hope this can help you to solve the problem.
Mauro.
Comment 5 Riyad Kalla CLA 2006-08-29 10:10:34 EDT
I ran into the identical problem Mauro did and have attached a project that exhibits the issue (just import it, and open the only JSP in the project).
Comment 6 Riyad Kalla CLA 2006-08-29 10:10:53 EDT
Created attachment 48962 [details]
Project to test the problem with
Comment 7 Nitin Dahyabhai CLA 2006-08-29 16:13:51 EDT
Did I accidentally create a dupe with bug 143209?
Comment 8 Amy Wu CLA 2006-08-29 16:32:52 EDT
Oh, yeah. Guess so.  And I see in that bug you already have a fix for the bug, so I'll just go ahead and assign this bug to you.
Comment 9 Amy Wu CLA 2006-10-05 15:17:25 EDT

*** This bug has been marked as a duplicate of 143209 ***
Comment 10 John Lanuti CLA 2007-04-03 12:07:42 EDT
Closing as fixed since M2.  Please reopen if closed in error.