facebook

MyEclipse 9 does not validate JSF 2.0 documents correctly

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

    I created a brand new web application, using EE 6. I added JSF 2.0 capabilities.

    The following (presumably) valid JSF 2.0 page fails to validate. The two h: tags are not recognized as valid:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"    
          xmlns:h="http://java.sun.com/jsf/html">
     
        <h:head>
            <title>JSF 2.0 Hello World</title>
        </h:head>
        <h:body>
            <h3>JSF 2.0 Hello World Example - welcome.xhtml</h3>
        </h:body>
    </html>
    

    Everything else is vanilla, but for completeness, here are some of the created files:

    .project

    
    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>VirginJSF20WebProject</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.wst.common.project.facet.core.builder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.wst.validation.validationbuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.jboss.tools.common.verification.verifybuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>com.genuitec.eclipse.jsf.jsfnature</nature>
            <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
            <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
            <nature>org.eclipse.jdt.core.javanature</nature>
            <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
            <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
            <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
            <nature>org.jboss.tools.jsf.jsfnature</nature>
        </natures>
    </projectDescription>
    

    .mymetadata

    
    <?xml version="1.0" encoding="UTF-8"?>
    <project-module
      type="WEB"
      name="VirginJSF20WebProject"
      id="myeclipse.1296581396956"
      context-root="/VirginJSF20WebProject"
      j2ee-spec="6.0"
      archive="VirginJSF20WebProject.war">
      <attributes>
        <attribute name="webrootdir" value="WebRoot" />
      </attributes>
    </project-module>
    

    .classpath

    
    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="con" path="melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_6_CONTAINER"/>
        <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
        <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
        <classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
    </classpath>
    

    org.eclipse.wst.common.project.facet.core.xml

    
    <?xml version="1.0" encoding="UTF-8"?>
    <faceted-project>
      <fixed facet="jst.jsf"/>
      <installed facet="java" version="1.6"/>
      <installed facet="jst.web" version="3.0"/>
      <installed facet="wst.jsdt.web" version="1.0"/>
      <installed facet="jst.jsf" version="2.0"/>
    </faceted-project>
    
    #314132 Reply

    support-swapna
    Moderator

    JeffreyGetzin,

    I could replicate it at my end. I will file a PR for the dev team.

    Sorry for the inconvenience caused.

    #314516 Reply

    Any progress on this issue?

    #314536 Reply

    support-swapna
    Moderator

    JeffreyGetzin,

    The fix is available in MyEclipse 9.0 M2.

    Have a look into this post which details the issues fixed in 9.0 M2 and on how to update your version :

    http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=26861&start=0&postdays=0&postorder=asc&highlight=

    Do let us know if you have any other issues

    #314614 Reply

    Swapna,

    The JSF validation is much improved. Many of the original errors are gone, however, I’m still seeing a few bizarre behaviors.

    For one, I’m getting an error with this statement:

    
    <f:selectItems var="item" value="#{someBean.someMethod()}"  itemValue="#{item.id}" itemLabel="#{item.longName}" />
    

    First, I guess you guys are using an older version of the EL standard, so you do recognize the call to someMethod() as being valid, here or in any other JSF file. That’s a nuisance, but not huge.

    The bigger problem is this. For each of “var”, “itemValue”, and “itemLabel”, validation marks them as errors and says, for example, “Unknown attribute (var)”.

    What’s weird, though, is if I delete those attributes, autocomplete will include them as options. In other words, autocomplete recognizes them as valid attributes but your validator does not. Weird, and annoying.

    Jeff

    #314639 Reply

    support-swapna
    Moderator

    JeffreyGetzin,

    For each of “var”, “itemValue”, and “itemLabel”, validation marks them as errors and says, for example, “Unknown attribute (var)”

    I could not replicate it at my end. Can you try creating a new JSF document and check if the issue persists?

    Regarding the someMethod(), I will have a dev team member answer it for you.

    Sorry for the inconvenience caused.

    #314648 Reply

    Ok, I did as you asked. I created a brand new XHTML document using the template, and then added my select. Here is the entire page:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
        <head>
            <title>My Facelets Page</title>
            <meta http-equiv="keywords" content="enter,your,keywords,here" />
            <meta http-equiv="description"
                content="A short description of this page." />
            <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    
            <!--<link rel="stylesheet" type="text/css" href="styles.css">-->
        </head>
        <body>
            <p>
                <h:selectOneMenu id="selectItem"
                    title="Select the item.">
                    <f:selectItems var="item"
                        value="#{someBean.someMethod()}"
                        itemValue="#{item.id}" itemLabel="#{itemk.longName}" />
                </h:selectOneMenu>        
            </p>
        </body>
    </html>
    

    I get the following errors:
    “Unknown attribute (var)”
    and
    “Multiple annotations found at this line:
    – Unknown attribute (itemLabel)
    – Unknown attribute (itemValue)”

    And I get the following warning for the call to someMethod(): “Syntax error in EL”

    If I delete, say, the var attribute and then invoke auto-suggest, it suggests the var attribute. I’m wondering if your auto-suggest algorithm uses classes in the classpath but your validation mechanism does not. If that were the case, perhaps there’s a tag library in a class path that’s giving me the valid suggestion but your validator isn’t picking up?

    Jeff

    #314658 Reply

    Brian Fernandes
    Moderator

    Jeff,

    Thanks for the detailed response – we’re looking at these issues right now.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: MyEclipse 9 does not validate JSF 2.0 documents correctly

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