Has anybody tried doing GSP design with Adobe Dreamweaver CS4? It has support for JSPs, but it doesn't recognize the gsp extension, and even if it did I think there would be problems regarding the gsp tags that it would not recognize. I found a little cookbook here (http://www.bitwalker.nl/blog/using-groovyserver-pages-in-dreamweaver) for getting GSPs partially working with Dreamweaver CS3, but many of the files and directories it references no longer appear to exist in CS4.
I think I got it working for CS5 after messing around for a while. Steps you need to do are similar to the article mentioned above, but with slight changes for Dreamweaver CS5. So five steps to go through and please make a test after each step to make sure you are on the right path.
Now we need to add correct document type so Dreamweaver CS5 knows about GSP. Edit %DreamweaverInstallationDirectory%\configuration\DocumentTypes\MMDocumentTypes.xml to add the following document type as the last node.
<documenttype id="GSP" servermodel="JSP" internaltype="Dynamic" winfileextension="gsp" macfileextension="gsp" file="Default.gsp" writebyteordermark="false" mimetype="text/html">
<TITLE>GSP</TITLE>
<description>Groovy Server Pages (GSP) document</description>
<dtdcontext>html</dtdcontext>
</documenttype>
If you want to provide Title and Description as localized strings refer to this article.
Setup GSP tag library. Download and unpack GspTagLibrary for Dreamweaver. Copy GSP folder with lots of *.vtm files into %DreamweaverInstallationDirectory%\configuration\TagLibraries. Edit %APPDATA%\Adobe\Dreamweaver CS5\en_US\Configuration\TagLibraries\TagLibraries.vtm to add content of gspTagLibrary.vtm as a last node. Replace first line with the following:
<taglibrary name="GSP tags" doctypes="GSP" id="DWTagLibrary_GSP" prefix="<g:">
Also add GSP into doctypes of <taglibrary> with id="DWTagLibrary_html" (should be very first node). Do the same changes for %DreamweaverInstallationDirectory%\configuration\TagLibraries\TagLibraries.vtm just in case. Restart Dreamweaver CS5 and make sure you can see GSP tags library in Edit > Tag Libraries... with correct Tag prefix (g:). Check if the 'Used in: GSP' checkbox is ticked for 'GSP tags' and 'HTML tags'.
Restart Dreamweaver CS5 and test if Edit > Preferences... > Code Coloring has GSP document type. Click 'Edit Coloring Scheme' to test if Preview has the code sample with code coloring as well as GSP tags mentioned in 'Styles for' list. And finally open up any of GSP files and check if it has code coloring for HTML, CSS, JavaScript and GSP tags.
That's it! Hope this helps to someone! And thanks to Harald Walker for the article I based my research on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With