Announcement Announcement Module
Collapse
No announcement yet.
GSP Tags not recognized by STS? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • GSP Tags not recognized by STS?

    Hi,

    I've just installed and started using the latest version STS with Grails 1.2-M4.

    So first, congrats (to SpringSource team) for this great product. The installation has worked smoothly and the Groovy editing is great.

    However, I encounter some warnings when opening my GSP pages :

    All of the Grails core gsp tag libs are not recognized by STS. For each tag, there is a warning saying
    Unknown tag (g:message)
    So :
    1 - What can I do to make STS recognize these tags?
    2 - If not possible, how to disable these annoying warnings?
    3 - I got the same kind of warnings for my own custom tag and GSP comments (%{--.....--}%)...so I'd like a solution for that as well


    Thank you very much for your help,

    Fabien

  • #2
    Hi Fabien,

    Grails support is still a bit experimental. I'd recommend that you upgrade to the latest nightly snapshot. We have recently made a few changes to Grails tooling that may address your problem.

    Here is the url for the nightly update site:
    http://dist.springsource.com/snapshot/STS/nightly/e3.5

    I'm happy to have a deeper look if you are still having problems.

    Comment


    • #3
      I forgot to mention that you should also update your Groovy-Eclipse to the latest snapshot from this update site:

      http://dist.codehaus.org/groovy/dist...snapshot/e3.5/

      Comment


      • #4
        Hi Andrew,

        Thanks for your help but the links you gave to me do not work (http://dist.springsource.com/snapshot/STS/nightly/e3.5) responds an 'access denied' and http://dist.codehaus.org/groovy/dist...snapshot/e3.5/ has only 2 xml files (compositeArtifacts and compositeContents)

        Fabien

        Comment


        • #5
          Add these two urls to your update manager in STS.

          Help -> Install New Software...

          1. In the section that says "Work with", add the Groovy-Eclipse URL first.
          2. Install all the required features.
          3. No need to restart
          4. Now add the STS link
          5. Look for the grails feature and install that.
          6. Restart

          Comment


          • #6
            Bit of thread necromancy here, but I'm using the latest release of STS (2.7.1) and I get warnings for GSP tags. It says that I'm using the GSP editor, it's just that I get these same "Unknown tag" messages for things like <g:form>.

            I'm working in a project that I created from a Maven archetype and then imported into the workspace, if that affects things. Thanks.

            Comment


            • #7
              What version of Grails? GSP support is not yet working on 1.4/2.0.

              Comment


              • #8
                Originally posted by Andrew Eisenberg View Post
                What version of Grails? GSP support is not yet working on 1.4/2.0.
                Should be 1.3.7.

                Comment


                • #9
                  This problem happens when the source code for the grails jars is not available (this is the current problem for 1.4/2.0). To see if this is the problem that you are having, try to open the FormatTagLib type. Do you see source code?

                  Comment


                  • #10
                    Originally posted by Andrew Eisenberg View Post
                    To see if this is the problem that you are having, try to open the FormatTagLib type. Do you see source code?
                    It looks like there's two copies of that on my classpath: the one from Ivy and the one from Maven. The source is not available in the jar from Maven.

                    If I go into the project properties and change the classpath loading order so that "Grails dependencies" is higher than "Maven dependencies," the warning goes away.

                    Comment


                    • #11
                      Ahhh...I missed that earlier. This is a project created through maven. Yes, our maven support is not as strong as it should be. There is an issue open for this on the issue tracker:
                      https://issuetracker.springsource.com/browse/STS-596

                      This is something that we are planning to work on for 2.8.0. There is a lot that we need to do since maven uses a very different way of managing classpath dependencies. I'll add a note to that issue to make sure that know that we need to work on gsp support as well.

                      Comment


                      • #12
                        Thanks for responding and following up so quickly! I have been pretty impressed with STS so far.

                        Comment


                        • #13
                          Good to know that this fixed your problems. We just need to make sure that Grails dependencies is always higher than maven dependencies (in actuality, we shouldn't even be using Grails dependencies in a Maven project, we should be falling back on the Maven dependencies so as not to put things on the classpath twice).

                          Comment


                          • #14
                            Originally posted by Andrew Eisenberg View Post
                            (in actuality, we shouldn't even be using Grails dependencies in a Maven project, we should be falling back on the Maven dependencies so as not to put things on the classpath twice).
                            And the Maven dependency should be providing source, but it seems it isn't. That's a separate issue, I guess.

                            Comment


                            • #15
                              Acquire source for FormatTagLib?

                              Originally posted by Andrew Eisenberg View Post
                              This problem happens when the source code for the grails jars is not availa 2.8.0ble (this is the current problem for 1.4/2.0). To see if this is the problem that you are having, try to open the FormatTagLib type. Do you see source code?
                              I am also facing this issue in STS where many tags like <g:form> and many others are shown as unknown tags. My configuration is:

                              STS 2.8.0
                              Grails 1.3.7
                              Groovy 1.7.0

                              I have only one copy of FormatTagLib type and it is the .class version. Will adding the source resolve this issue? If so how do I get this source?

                              Comment

                              Working...
                              X