- This topic has 3 replies, 3 voices, and was last updated 17 years, 5 months ago by Loyal Water.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
Rob TannerMemberHi,
The following snippet is repeated 5 times on a JSP page. The object “aliases” is obviously an Iterator and if there is a “next” value it becomes the VALUE argument in the INPUT element. The designer flags errors but the page displays correctly, including displaying the value argument when applicable. Can anyone tell me why the designer is complaining?
<td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td>
Thanks,
RobRob Tanner
Linfield College
support-eugeneMemberWhat error do you see?
I created a page like this:
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'MyJsp1.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <% Iterator aliases = null; %> <table> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> <tr> <td> <input type="text" name="alt.01" id="alt.01" size="24" maxlength="24" style="font-family:monospace; color:#7f0000" <% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %> /> </td> </tr> </table> This is my JSP page. <br> </body> </html>
And there is no errors or warnings.
Rob TannerMemberThis is the error — actually it’s a yellow warning:
Undefined attribute name (<% if ( aliases.hasNext() ) out.println(" value=\"" + aliases.next() + "\""); %>).
Loyal WaterMemberHi Rob,
Even I was unable to reproduce this warning at my end. Can you paste the JSP Code that is giving you the warning. What version of MyEclipse are you using ? -
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)