facebook

JSP Validation warnings on implicit objects

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

    szafir
    Member

    The auto completion suggests the use of implicit objects such as application, out but the validation engine warns us that these variables can only be null. A smaller issue is the also the “exception” implicit object available when the isErrorPage page directive is set to true.

    #252551

    Riyad Kalla
    Member

    Can you please post all the information we request in the [URL=http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-393.html]Posting Guidelines[/URL] thread at the top of this forum? That will give us some context so that we can determine if this is an installation issue, a configuration problem, or a bug. Thanks.

    #252561

    szafir
    Member

    *** Date: Thu May 25 14:26:54 EDT 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_06

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.0 Milestone 1
    Build id: 20060515-5.0-M1

    *** Eclipse details:
    Eclipse SDK

    Version: 3.2.0
    Build id: I20060519-1206

    Eclipse Platform

    Version: 3.2.0.v20060518-_OZ2g5CC6lxEcKN
    Build id: I20060519-1206

    Eclipse RCP

    Version: 3.2.0.v20060511-2000-VDNgUk84W-MjLLR
    Build id: I20060519-1206

    Eclipse Java Development Tools

    Version: 3.2.0.v20060518-0800-F7snp7fkt1-SXVP
    Build id: I20060519-1206

    Eclipse Plug-in Development Environment

    Version: 3.2.0.v20060511-1200-6zXJJzJsQooFXED
    Build id: I20060519-1206

    Eclipse Project SDK

    Version: 3.2.0.v20060404-uDflzhCgQw7A-gJ
    Build id: I20060519-1206

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse-3.2RC5\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    9c_74
    -vm
    C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe

    The error log is very big but it doesn’t seem to contain anything relevant to my problems

    #252567

    Riyad Kalla
    Member

    Try and copy paste this into a file and save it, on my install it shows no validation errors:

    
    <%@ 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 'index.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>
      <%= request.getSession() %>
      <%= application.getMajorVersion() %>
        This is my JSP page. 2<br>
        Hello ${ (param.isLoggedIn == false) ? "" : param.name }
      </body>
    </html>
    

    If you see that I’ve missed something, give me a snippet of code to test.

    #252568

    szafir
    Member

    This is a perfectly good example and it yelds three warnings:
    1) line 1:

    The import java.util is never used

    which is fine
    2) line 2:

    The variable out can only be null; it was either set to null or checked for null when last used

    which is very weird because out is never used
    3) line 26:

    The variable application can only be null; it was either set to null or checked for null when last used

    which is the problem i was referring to

    #252569

    szafir
    Member

    Actually in the second warning, the line number is 5, but this one is weird, maybe it will go away if i restart something, so maybe ignore it.

    #252570

    szafir
    Member

    A simpler version to work with is the following, which only warns about the application being null:

     <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>My JSP 'index.jsp' starting page</title>
      </head>
      <body>
        <%= application.getMajorVersion() %>
      </body>
    </html>
    
    #252572

    Riyad Kalla
    Member

    Can you open your Eclipse directory then go under plugins, do you have any “wtp” or “sse” plugins listed there? I cannot reproduce the behavior you are seeing.

    #252573

    szafir
    Member

    No they aren’t there, are they supposed to be there ? Was I supposed to install WTP prior to installing MyEclipse ?

    #252574

    szafir
    Member

    I did the same test inside a new test project and there is no warning, so I suppose that my project has some configuration issues. If I find it, I will post it here.

    #252575

    szafir
    Member

    Sorry, the validation hadn’t run, same behaviour in a completely empty test web project.

    #252577

    szafir
    Member

    Actually, i wouldn’t bother with the warnings if the menu option “Remove All Validation Markers” was still under MyEclipse but for some reason it has been removed in 5.0M1.

    #252614

    Riyad Kalla
    Member

    I’m in the midst of trouble shooting an issue with 5.0M1 where I see *no* validation markers, and in your case you are seeing too many. Let me get a handle on the validation in general and then I’ll look into this. In the mean time can you export this project to a ZIP and send it to me? support@genuitec.com ATTN Riyad, also include a link to this thread so I know why I’m getting it.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: JSP Validation warnings on implicit objects

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