9 Replies Latest reply on May 28, 2008 8:47 AM by arne anka

    comment/uncomment in .xhtml

    Ivan B Novice

      I'm ashamed to ask this, but can anyone suggest how to comment/uncomment pieces of .xhtml files in eclipse with JBossTools installed?

      I'm new to Eclipse (switching from IDEA), there must be some plugin for this, probably. I tried to use xmlbuddy in hope for finding this silly bit of functionality, but the plugin has it's own syntax highlighting, so dumped it.

        • 1. Re: comment/uncomment in .xhtml
          Adrian Mitev Master

          xhtml is html with strict xml syntax. Use the standard <!-- --> xml comment

          • 2. Re: comment/uncomment in .xhtml
            Ivan B Novice

             

            "amitev" wrote:
            xhtml is html with strict xml syntax. Use the standard <!-- --> xml comment


            Thanks, that's useful.
            Manuall adding comments while automatically handling transactions and ORM and all the rest of hi-tech, sounds brilliant.


            • 3. Re: comment/uncomment in .xhtml
              Ivan B Novice

              Just found out that <!-- #{Seam EL} --> is actually run within the comments.

              IMHO it shouldn't be so, at least we need another pair of comment tags, cause if I need to e.g. temporarily switch off the creation of some component referenced in the page, simple commenting isn't enough, I need to remove that piece of code altogether from the page.


              • 4. Re: comment/uncomment in .xhtml
                Max Rydahl Andersen Master

                1) Put it in jira - I'm actually surprised eclipse default xml editor doesn't have a "comment selection" feature. Should be trivial to add.

                2) About el in xml comments then you should raise that in the seam forum (please point us to the thread so we can follow ;) since that is part of how facelets/seam/jsf work. (I have a vague memory about it being an option somewhere wether comments should be evaluated or not)

                • 5. Re: comment/uncomment in .xhtml
                  steve tynor Novice

                  Put this in your web.xml to cause comments to be completely removed from the rendered page (so the EL inside them doesn't get evaluated).

                   <context-param>
                   <param-name>facelets.SKIP_COMMENTS</param-name>
                   <param-value>true</param-value>
                   </context-param>
                  


                  Seems like this would be the more sensible default that not skipping them, but such is how it works...

                  FWIW, It's a Seam FAQ: http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamProblemsFAQ


                  • 6. Re: comment/uncomment in .xhtml
                    arne anka Newbie

                    > 1) Put it in jira - I'm actually surprised eclipse default xml editor doesn't have a "comment selection" feature. Should be trivial to add.

                    eclipse xml editor has -- jboss tools xhtml editor does not.
                    just stumbled over exactly the same want of a shortcut in the xhtml editor.
                    on the other hand it suffers from the same weakness as the xml editors in eclipse:
                    typing
                    <!--
                    automatically closes with
                    -->
                    which is mostly unwanted -- but if you remove the closing part and add it later on the validator chokes and insists there is no closing part. no way to force reconsidering.

                    additionally it tells you that there is no tag <! whatever that means.

                    • 7. Re: comment/uncomment in .xhtml
                      Max Rydahl Andersen Master

                      we are adding in the missing comment feature.

                      the <!-- --> is something you can disable afaik.

                      the there is no tag <! line i dont understand what you are referring to.

                      • 8. Re: comment/uncomment in .xhtml
                        Christian Douven Newbie

                        There should also be a function like "CTRL+7" in the Java-Editor, so that a whole block can be commented at once.

                        • 9. Re: comment/uncomment in .xhtml
                          arne anka Newbie

                           

                          "max.andersen@jboss.com" wrote:

                          the <!-- --> is something you can disable afaik.


                          yes, but on the expense of other usefull completions, afar.
                          i once found where to disable but forgot gaian, because the drawback prevailed.
                          there's imho an eclipse bug regarding this -- don't know how far your xhtml-editor uses the eclipse stuff underneath.

                          "max.andersen@jboss.com" wrote:

                          there is no tag <! line i dont understand what you are referring to.


                          of course not. but that's what the error mark hover says.