7 Replies Latest reply on Mar 26, 2017 3:45 PM by snarff

    Eclipse support (JSF issue)?

    snarff

      I am playing with Java Server Faces on WIldfly, developing with eclipse.

      I can successfully create, deploy and run a simple project with a .jsp where I combine java and html.

      However, I cannot wrap my head around using simple tags like <f:view>.
      Whatever I do, the taglibs
      <%@ taglib ...>
      are flagged with "Can not find the tag library descriptor..." errors, and subsequent use of tags yield an "Unknown tag <f:view>" error.

      I googled old issues with tag libraries, which suggest eclipse support for WildFly was complicated in a distant past, but nothing more recent (running eclipse neon), so I guess I am overlooking something real basic. Do I need to tweak WIldFly to get JSF support? Need to tweak eclipse to get WildFly support? Any help is appreciated...

        • 1. Re: Eclipse support (JSF issue)?
          ctomc

          Eclipse is bit picky when it comes to this.

           

          If you are using maven, I would suggest that you import WildFly BOM to you project GitHub - wildfly/boms at 10.x

           

          and then add this dependancy

           

          <dependency>

                  <groupId>org.jboss.spec.javax.servlet.jstl</groupId>

                  <artifactId>jboss-jstl-api_1.2_spec</artifactId>

                  <scope>provided</scope>

          <dependency>

           

          to you module, which should get your problems solved.

          • 2. Re: Eclipse support (JSF issue)?
            snarff

            Tomaz Cerar wrote:

             

            Eclipse is bit picky when it comes to this.

             

            If you are using maven, I would suggest that you import WildFly BOM to you project GitHub - wildfly/boms at 10.x

             

            and then add this dependancy

             

            <dependency>

            <groupId>org.jboss.spec.javax.servlet.jstl</groupId>

            <artifactId>jboss-jstl-api_1.2_spec</artifactId>

            <scope>provided</scope>

            <dependency>

             

            to you module, which should get your problems solved.

            I took this opportunity to switch to maven. However, this dependency makes maven complain that 'For artifact {org.jboss.spec.javax.servlet.jstl:jboss-jstl-api_1.2_spec:null:jar}: The version cannot be empty. (org.apache.maven.plugins:maven-war-plugin:3.0.0:war:default-war:package)' ?

            • 3. Re: Eclipse support (JSF issue)?
              ctomc

              did you properly import boms?

              you should have boms imported in your pom.xml like this:

              <dependencyManagement>

                  <dependencies>

                      <dependency>

                          <groupId>org.wildfly.bom</groupId>

                          <artifactId>wildfly-javaee7</artifactId>

                          <scope>import</scope>

                          <type>pom</type>

                          <version>10.0.1.Final</version>

                      </dependency>

                  </dependencies>

              </dependencyManagement>

              • 4. Re: Eclipse support (JSF issue)?
                snarff

                Looks like I import the bom properly. However, the Maven POM editor does not allow me to set scope to import, so I edited the pom.xml. Could it be I have the wrong Maven version?

                • 5. Re: Eclipse support (JSF issue)?
                  ctomc

                  any maven from 3.x series should be fine, 3.3.9 would be best

                   

                  can you paste whole pom.xml file you have?

                  • 6. Re: Eclipse support (JSF issue)?
                    snarff

                    Contents of pom.xml:

                     

                    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

                      <modelVersion>4.0.0</modelVersion>

                      <groupId>test</groupId>

                      <artifactId>test</artifactId>

                      <version>0.0.1-SNAPSHOT</version>

                      <packaging>war</packaging>

                      <build>

                        <sourceDirectory>src</sourceDirectory>

                        <plugins>

                          <plugin>

                            <artifactId>maven-compiler-plugin</artifactId>

                            <version>3.5.1</version>

                            <configuration>

                              <source>1.8</source>

                              <target>1.8</target>

                            </configuration>

                          </plugin>

                          <plugin>

                            <artifactId>maven-war-plugin</artifactId>

                            <version>3.0.0</version>

                            <configuration>

                              <warSourceDirectory>WebContent</warSourceDirectory>

                            </configuration>

                          </plugin>

                        </plugins>

                      </build>

                      <dependencyManagement>

                          <dependencies>

                              <dependency>

                                  <groupId>org.jboss.spec.javax.servlet.jstl</groupId>

                                  <artifactId>jboss-jstl-api_1.2_spec</artifactId>

                                  <scope>provided</scope>

                              </dependency>

                              <dependency>

                                  <groupId>org.wildfly.bom</groupId>

                                  <artifactId>wildfly-javaee7</artifactId>

                                  <version>10.0.1.Final</version>

                                  <scope>import</scope>

                              </dependency>

                          </dependencies>

                      </dependencyManagement>

                    </project>

                     

                    Just realised I had to include the dependency for jboss-jstl-api_1.2_spec under the managed dependencies.

                    So, now maven is no longer complaining about  missing version numbers.

                     

                    However, the taglib errors are still there: nothing has changed.

                    • 7. Re: Eclipse support (JSF issue)?
                      snarff

                      Looks like somehow my eclipse installation was screwed up, since after a clean reinstall of eclipse and plugins used, I got this to work as expected.

                      Tomaz, thanks for the time you put into this!