facebook

I’m getting apparently invalid errors in Visual JSP Designer

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #270528 Reply

    Rob Tanner
    Member

    Hi,

    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,
    Rob

    Rob Tanner
    Linfield College

    #270543 Reply

    What 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.

    #270593 Reply

    Rob Tanner
    Member

    This is the error — actually it’s a yellow warning:

    
    Undefined attribute name (<% 
                        if 
                                 ( aliases.hasNext()  )
                                                    
                                 out.println(" value=\"" + aliases.next() + "\"");
                                            
                                            %>).
    
    #270626 Reply

    Loyal Water
    Member

    Hi 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 ?

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: I’m getting apparently invalid errors in Visual JSP Designer

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