6 Replies Latest reply on Apr 12, 2011 4:10 AM by u j

    Visual Editor: Template file is not found

    u j Novice

      I created a Richfaces 4 web application with Maven and open the sample index.xhtml file with the visual editor.

      The part <ui:composition template="/templates/template.xhtml">

      is marked red with "Template file is not found", although the file exists and the path is correct (the folder templates is in the same directory as index.xhtml).

       

      Thanks,

      Ulrich

        • 1. Visual Editor: Template file is not found
          u j Novice

          If I remove the leading slash, i.e. templates/template.xhtml, the error disappears.

          But this is not as it should be, so I assume that is a bug in jboss tools.

          • 2. Visual Editor: Template file is not found
            Max Rydahl Andersen Master

            VPE resolves the relative path templates/template.xhtml without any problems since it is relative to the current file.

             

            /templates/template.xhtml is on the other hand absolute and thus it needs to know the root of your webapp to resolve it.

             

            A couple of ways to do that:

             

            1) Edit VPE page settings for the xhtml to set the root webcontent.

            or

            2) Right click project and click Configure > Enable JSF which will setup WTP on the project

            or

            3) install Jboss tools maven integration and Maven > Update Project Configuration and it shuold be enabled on its own.

             

            #3 is probably your best option here since you are using Maven.

            • 3. Visual Editor: Template file is not found
              u j Novice

              Thanks for the reply.

              I had JSF Capabilities already enabled and JBoss Maven integration installed, but the problem persists.

              Could you please explain your point 1 a bit more detailed? Where do I edit the page settings?

               

              Thanks,

              Ulrich

              • 5. Visual Editor: Template file is not found
                Denis Golovin Master

                Could you check what you have in .settings/org.eclipse.wst.common.component file? I'm curious what is in wb-resource element with deploy-path="/" attribute?

                • 6. Visual Editor: Template file is not found
                  u j Novice

                  Alexej, your third option worked. And after restarting Eclipse, now it works even without setting the absolute folder!

                   

                  Denis, the file content is:

                  <?xml version="1.0" encoding="UTF-8"?>

                  <project-modules id="moduleCoreId" project-version="1.5.0">

                      <wb-module deploy-name="smsurbano">

                          <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>

                          <wb-resource deploy-path="/" source-path="/src/main/webapp"/>

                          <property name="context-root" value="smsurbano"/>

                          <property name="java-output-path" value="/smsurbano/target/classes"/>

                      </wb-module>

                  </project-modules>

                   

                  Before, I had another line in the file (see thread http://community.jboss.org/thread/162518?tstart=0) which was always recreated when I right-clicked on the project and chose Maven>Update Project Configuration. Now I deleted it again and this time it was not recreated (due to the restart of Eclipse?). Maybe this was the reason that the path was not resolved correctly.

                   

                  Thanks,

                  Ulrich