0
votes

I'm running Grails 1.3.6. I have this in my URLMappings.groovy file ...

static mappings = {
    "/$folder?/$page?"{
        controller = "Home"
        action = "index"
    }

    "/"(view:"/index")
    "500"(view:'/error')
}

and this is my HomeController ...

class HomeController {
def IOService

def index = {
    def folder = params.folder;
    def page = params.page;

    def contents = IOService.getFileContents(folder, page)  
    response.setContentType("application/json")
    response.text = contents
}   
}

however, when I visit my URL "/context-path/folder1/page1", I'm getting an Apache Tomcat 404 error (complaining about "/context-path/folder1"). I'm new to Grails but can't figure this out. How can I adjust my mappings to make this work?

Thanks, - Dave

1

1 Answers

0
votes

I'm not sure if controller/action definitions are case-insensitive. I've always used lowercase names. Try changing

controller = "Home"

to

controller = 'home'