Search
Search Menu

Using GroovyServer Pages in Dreamweaver

gsp tag support in DreamweaverWe started using Grails in our current project for one of the internal web-applications. Grails uses GroovyServer Pages (gsp) for web pages and layout templates (you can also use JSP instead). As I don’t like to use Eclipse for web-design tasks, I figured out how to add gsp support to Dreamweaver (CS3).

Step 1: Add .gsp file extension
Edit the Extensions.txt file, which can be found here:
Windows: \Documents and Settings\username\Application Data\Adobe\Dreamweaver 9\Configuration
Mac OS X: /Users/username/Library/Application Support/Adobe/Dreamweaver 9/Configuration
Add a new line with GSP:Groovy Server Pages and add the gsp extension to the first line. Restart Dreamweaver, which will now recognize the .gsp files and open them in the editor.
Next, add the following code to configuration/DocumentTypes/MMDocumentTypes.xml

<documenttype id="GSP" internaltype="Dynamic" winfileextension="gsp" macfileextension="gsp" file="Default.gsp" writebyteordermark="false">
<TITLE>
<MMString:loadString id="mmdocumenttypes_70" />
</TITLE>
<description>
<MMString:loadString id="mmdocumenttypes_71" />
</description>
<dtdcontext>html</dtdcontext>
</documenttype>

Adjust the id values if necessary. In the folder NewDocuments create a Default.gsp file. Gsp files are not being shown as option in the new files dialog yet, so the Default file is not being used. If someone knows how to do this, please let me know.
It takes adobe a couple of pages to explain it all in detail: http://www.adobe.com/go/16410

Step 2: Add the gsp tag library
Download the GspTagLibrary for Dreamweaver, unpack it and copy the gsp folder to the TagLibraries folder within the configuration folder. Add the text of gspTagLibrary.vtm to the existing TagLibraries.vtm file.

Step 3: Enable code coloring
Open CodeColoring.xml (Configuration/CodeColering) in an editor and add gsp to the doctypes attribute of the entries for Html, JavaScript and CSS. Restart Dreamweaver.

Next step could be to add a special color schema for gsp tags and groovy when using scriptlets and maybe one day I will have time to learn how to write Dreamweaver Extensions, which would hopefully make it possible to do all of this automatically.

8 Comments Write a comment

  1. Pingback: edit gsp page in Dreamweaver « Supereka’s Weblog

  2. Hi. I’ve tried use your advice to configure Dreamweaver CS4 (Mac), but it does not work. Have you any suggestion about this issue?

  3. I have tried modifying the Dreamweaver files noted for DW CS4 and it cannot find a valid editor when trying to open a gsp

  4. Doesn’t work for CS5 version either

  5. I am hardly using Dreamweaver any longer. Don’t think I am upgrading from CS4 to CS5 either.

  6. Just tried this today – worked great for me. Still on Dreamweaver CS3 so this was a great find. Only tip I’d share is that the CodeColoring.xml file that needs to be edited is not the one in the Application configuration location bur rather the User >Library >Application Support folder. I’m on a Mac and was able to follow this without a problem. Thanks again for the tip.

  7. It’s works for Dw CS5. Thanks for the aport.

Leave a Comment

Required fields are marked *.