## 6.2.6 Making Changes to a Deployed Application

One of the main issues with deploying a Grails application (or typically any servlet-based one) is that any change to the views requires you to redeploy your whole application. If all you want to do is fix a typo on a page, or change an image link, it can seem like a lot of unnecessary work. For such simple requirements, Grails does have a solution: the `grails.gsp.view.dir` configuration setting.

How does this work? The first step is to decide where the GSP files should go. Let's say we want to keep them unpacked in a `/var/www/grails/my-app` directory. We add these two lines to `grails-app/conf/Config.groovy` :

    grails.gsp.enable.reload = true
    grails.gsp.view.dir = "/var/www/grails/my-app/"

The first line tells Grails that modified GSP files should be reloaded at runtime. If you don't have this setting, you can make as many changes as you like but they won't be reflected in the running application. The second line tells Grails where to load the views and layouts from.

> The trailing slash on the `grails.gsp.view.dir` value is important! Without it, Grails will look for views in the parent directory.

With those settings in place, all you need to do is copy the views from your web application to the external directory. On a Unix-like system, this would look something like this:

    mkdir -p /var/www/grails/my-app/grails-app/views
    cp -R grails-app/views/* /var/www/grails/my-app/grails-app/views

The key point here is that you must retain the view directory structure, including the `grails-app/views` bit. So you end up with the path `/var/www/grails/my-app/grails-app/views/...` .

One thing to bear in mind with this technique is that every time you modify a GSP, it uses up permgen space. So at some point you will eventually hit "out of permgen space" errors unless you restart the server. So this technique is not recommended for frequent or large changes to the views.