facebook

JSP editor does not validate

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

    I installed Eclipse 3.2.1 and MyEclipse 5.1 on my RHE 3 Linux workstation. I then checked out my Web project from CVS and edited a JSP file that contains JSTL and Struts tags. The JSP editor validation is not working. I checked the validation settings and found the JSP validator turned off so I enabled it. I then created some invalid JSTL tags and the validator is still not working. I also checked to see if my project was overriding the JSP validation settings and it was not.

    Please help.

    I am currently using Eclipse 3.1.2 and MyEclipse 4.1.1 as my primary development platform and JSP validation works great with the same project.

    A couple of notes. I get the popup that the visual design views will be disabled because of the browser issue. I have tried editing the JSP file with both the MyEclipse JSP Editor and the MyEclipse Visual JSP Designer. Both fail to validate the JSP file.

    I tried creating a startup script to work around the internal browser issue. When I fired up eclipse with the script, I received a bunch of Exceptions and stack traces when displaying a JSP file.

    Please help. I must fall back to my Eclipse 3.1.2 and MyEclipse 4.1.1

    Thanks,
    Keith

    #262039 Reply

    Riyad Kalla
    Member

    Keith,
    Can you paste, from your new install, the information from MyEclipse > Installation Summary > Installation Details here for me?

    Also, can you right click on your JSP file and make sure that it is being opened with the MyEclipse JSP Editor?

    #262089 Reply

    Also, can you right click on your JSP file and make sure that it is being opened with the MyEclipse JSP Editor?

    The default editor is the JSP visual designer. I explicitly openned a JSP file with the MyEclipse JSP Editor using the “Open With” context menu option.

    The editor did not validate (or mark invalid) some broken JSTL code. I looked at the projects properties/My Eclipse/Validation. The JSP syntax validation and JSP semantics validation were checked.

    I did notice that the Validation Builder checkbox was unchecked. I don’t know what this is.

    I then tried creating a new Web project. I configured this project to reference the struts and JSTL jars in my common Java project. I then created a JSP file with struts and jstl tags. It also did not identify invalid jstl tags.

    Here are my installation details:

    
    *** Date: 
    Thursday, November 16, 2006 3:23:34 PM PST
    
    ** System properties:
    OS=Linux
    OS version=2.4.21-47.0.1.ELsmp
    Java version=1.5.0_09
    
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.1.0 GA
    Build id: 20061111-5.1.0-GA
    
    
    *** Eclipse details:
    Eclipse SDK
    
    Version: 3.2.1
    Build id: M20060921-0945
    
    
    
    
    Eclipse Platform
    
    Version: 3.2.1.r321_v20060921-b_XVA-INSQSyMtx
    Build id: M20060921-0945
    
    
    Eclipse RCP
    
    Version: 3.2.1.r321_v20060801-2ekW2BxmcpPUOoq
    Build id: M20060921-0945
    
    
    Eclipse Java Development Tools
    
    Version: 3.2.1.r321_v20060905-R4CM1Znkvre9wC-
    Build id: M20060921-0945
    
    
    Eclipse Plug-in Development Environment
    
    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20060921-0945
    
    
    Eclipse Project SDK
    
    Version: 3.2.1.r321_v20060801-tQ1w49KnTArT0FZ
    Build id: M20060921-0945
    
    
    Eclipse Graphical Editing Framework
    
    Version: 3.2.1.v20060921
    Build id: 20060921-1617
    
    
    
    
    Eclipse startup command=-os
    linux
    -ws
    gtk
    -arch
    x86
    -launcher
    /home/kdf/eclipse-3.2/eclipse/eclipse
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    180015
    -vm
    /usr/java/jdk/bin/java
    
    
    #262094 Reply

    Riyad Kalla
    Member

    Keith,
    What happens when you put it something like this?

    
    <% INVALID
    

    in your JSP page and save it? (copy and paste what I put, invalid scriptlet segment like that)

    #262098 Reply

    As soon as I added your invalid scriptlet segment, I saw red squares in the right hand side of the editor. When I saved the JSP file, red circles with white ‘X’s appeared on the left hand side of the editor. So editor is identifying this as invalid.

    BTW, I decided to set the default editor for JSP and JSPF files to the MyEclipse JSP editor in the Eclipse Preferences. I got tired of clicking through the pop-up box about the browser problem.

    #262103 Reply

    Riyad Kalla
    Member

    Keith,
    It sounds like validation is working… can you give me a specific example of errors you are not seeing marked?

    #262169 Reply

    Validation of custom tags from standard tag libraries isn’t working. I have prepared a simple example. I have included a sample JSP snippet that contains both Struts and JSTL tags. In a separate include file, I have the tag library declarations:

    JSP Snippet

    
    <%@ include file="/includes/tag_lib_defs.jspf"%>
    
    <html:link action="/category" paramId="no" paramName="category"
        paramProperty="id" styleClass="no_line">
            <c:if test="${!empty category.thumbnailImageURL}">
                <html:img src="${category.thumbnailImageURL}"
                    styleClass="photo_border_thumbnail" border="0" hspace="3"
                    align="absmiddle" height="30" width="30"
                    alt="${fn:escapeXml(category.name)}" />
            </c:if>
            <c:out value="${category.name}" />
    </html:link>
    

    Tag Library Declarations File (/includes/tag_lib_defs.jspf)

    
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    <%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %> 
    <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
    <%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
    <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
    

    In MyEclipse 4.1.1, If I alter the tag name “<html:link” to “<html:lnk”, I get the validation error ‘No tag “lnk” defined in tag library imported with prefix “html”‘. MyEclipse 5.1 does not identify this tag as invalid.

    If I do the same thing with a JSTL tag, for example “<c:if” as “<c:f”, MyEclipse 5.1 does not flag this as an error.

    In MyEclipse 4.1.1, If I alter an attribute name in a custom tag, I also get a validation error. For example, if I alter the attribute “action” in the “<html:link” tag to “acion”, I get the validation error “Attribute acion invalid for tag link according to TLD”. MyEclipse 5.1 does not flag this as an error.

    #262170 Reply

    Riyad Kalla
    Member

    I think you just found a bug. I did some testing on my end, and if you name the file “taglibDefs” or any other name that doesn’t have underscores in it, the tag validation works. But if you use underscores, it breaks. I’m filing this for investigation.

    #262179 Reply

    I removed the underscores from the included file and it didn’t make any difference. Still didn’t work. I also missnamed the file and noticed that the JSP editor didn’t flag that as an error either. In 4.1.1, if the included file didn’t exist, it was flagged as an error.

    #262180 Reply

    I discovered a separate validation issue with my Web project. I discovered that MyEclipse 5.1 is validating ‘*.jspf’ files. In 4.1.1, it didn’t do that. MyEclipse 5.1 is displaying validation errors on many of my JSPF files because variables exist in these files, but they are not declared in these files. They were declared in the outer JSP file. Is this a bug, or do I need to change a setting?

    #262182 Reply

    Riyad Kalla
    Member

    Keith,
    Is this project actually a web project, or a Java project? (Under project preferences, do you have MyEclipse then Web preference panel?)

    Also, under Window > Prefs > MyEclipse > Editors > JSP, do you have jspf extension listed as a “fragment” extension?

    #262187 Reply

    Is this project actually a web project, or a Java project? (Under project preferences, do you have MyEclipse then Web preference panel?)

    This is a Web project. There is a Web preference under the MyEclipse project preference.

    Also, under Window > Prefs > MyEclipse > Editors > JSP, do you have jspf extension listed as a “fragment” extension?

    under Window > Prefs > MyEclipse > Files & Editors > JSP, I don’t see a place in the preferences that lists “fragment” extensions. The only thing listed on this panel related to fragments is the checkbox “Validate JSP fragments”. It was checked. I unchecked it, cleared the MyEclipse validation markers and then validated the project. The JSPF files are no longer displaying validation errors.

    The problem with validating the custom tags and the nonexistent include file still exists.

    #262814 Reply

    Riyad Kalla
    Member

    Keith,
    I received your test project and was able to reproduce the issue right away. The reconciler catches the warning, but you are right, the validator is not marking the tag as uknown *or* marking the variable as invalid as it should be. As soon as you move the files into a web project along with the libraries, things start behaving. This does look like a bug, I’ll file it ASAP.

    #265004 Reply

    Riyad,

    Can you give me some idea when the next release of MyEclipse is planned? Since the bug with JSP validation exists in the current release, I can’t move to MyEclipse 5.1, so I waiting for the next release to see if it is fixed. There are some very nice features in Eclipse 3.2/MyEclipse 5.1 that I would like to use.

    Thanks,
    Keith

    #265008 Reply

    Riyad Kalla
    Member

    Keith,
    Our next release will be 5.5 around March timeframe. We will have a Milestone 1 release out in about a week and I would like it if you could test it out and beat on it and see how things are looking.

Viewing 15 posts - 1 through 15 (of 32 total)
Reply To: JSP editor does not validate

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