Archive

Archive for the ‘spy’ Category

Released Grails Spy plugin 0.2

July 6th, 2010 No comments

I just released version 0.2 of my Grails Spy plugin.

About

The Grails Spy plugin provides some views to inspect Grails internals such as the Spring application context(s), artefacts, etc.

As most of the beans of the Grails WebApplicationContext are constructed at runtime with the help of a BeanBuilder, there is no Spring xml file with bean definitions.

In order to browse the dynamic bean definitions, Grails Spy can be used to watch into an application’s guts.

Installation

grails install-plugin spy

Usage

Simply install the plugin, enable the Spy controller for the dev environment and run grails run-app. Then browse to http://localhost:8080/yourapp/spy and enjoy.

Changes

  • For security reasons the Spy controller must now be enabled in Config.groovy:
    grails.plugins.spy.enabled = true
    

    The plugin can be enabled or disabled individually for each environment. Example:

    environments {
        production {
            grails.serverURL = "http://www.changeme.com"
        }
        development {
            grails.serverURL = "http://localhost:8080/${appName}"
    	grails.plugins.spy.enabled = true
        }
        test {
            grails.serverURL = "http://localhost:8080/${appName}"
        }
    }
    
  • 'inspect' is now the default action for the spy controller, so it can be called as http://localhost:8080/yourapp/spy instead of http://localhost:8080/yourapp/spy/inspect

License

The Spy plugin is released under the Apache License 2.0.

Source code and Issues

The source code is hosted at GitHub, issues can be reported here.

Screenshots

Eye-candy you say? See below:

GrailsSpy: GrailsApplication

GrailsSpy: ApplicationContext view

GrailsSpy: bean view

Fork me on GitHub
Categories: grails, plugin, spy Tags:

Released Grails spy plugin

January 6th, 2010 1 comment

While digging through the inner workings of Grails in order to improve my OSGi plugin, it is sometimes necessary to inspect the GrailsApplication object and its companion Spring ApplicationContext(s).

As most of the beans of the Grails WebApplicationContext are constructed at runtime with the help of a BeanBuilder, there is no Spring xml file with bean definitions.

Only the main application context can be inspected, e.g. by extracting it from the generated war file:

jinspect -a target/myapp-0.1.war

In order to browse the dynamic bean definitions I created a little plugin called Grails Spy, which can be used to watch into an application’s guts.

License

The Spy plugin is released under the Apache License 2.0.

Source code and Issues

The source code is hosted at GitHub, issues can be reported here.

Installation

As always, simply execute grails install-plugin spy.

Note: until the Grails plugin page is sync’ed, the plugin can also be installed using
grails install-pluginhttp://cloud.github.com/downloads/jetztgradnet/grails-spy-plugin/grails-spy-0.1.zip

Usage

Simply browse to http://localhost:8080/myapp/spy/ and have a closer look.

Note: this path is NOT PROTECTED, so don’t do this in a production environment! Or at least use one of the security plugins to protect this page.

Screenshots

Eye-candy you say? See below:

GrailsSpy: GrailsApplication

GrailsSpy: ApplicationContext view

GrailsSpy: bean view

Categories: grails, plugin, spy Tags: