2011-03-17 5 views
0

Grails 1.2.1을 사용하고 있습니다. 나는 방문 할 때 내가 404을 받고 있어요, 그러나 ... Grails URL 매핑 질문

http://localhost:8080/context-path/mediaproxy

그래서 내 URLMappings.groovy 파일이 추가 ...이 매핑을 설정하는

class UrlMappings { 
    static mappings = { 
     ‰name mediaproxy: "/mediaproxy" { 
      controller = "SocialMediaCacheProxy" 
      action = "index" 
     } 
     "/"(view:"/index") 
     "500"(view:'/error') 
    } 

} 

을 원하는 위 URL 여기 내 컨트롤러를 설정하는 방법입니다

class SocialMediaCacheProxyController { 

    def index = { 
     if (params.dumpAll != null) { 

     } else if (params.url != null) { 
      doCacheTransport(params, response); 
     } // if 
    } 

... 
} 

내가 뭘 잘못하고 있는거야? ‰ (

class UrlMappings { 
    static mappings = { 
     "/mediaproxy" { 
      controller = "SocialMediaCacheProxy" 
      action = "index" 
     } 
     "/"(view:"/index") 
     "500"(view:'/error') 
    } 
} 

답변

0

그것은 귀하의 질문에 서식 몇 가지 문제가 될 수도 있지만 나는 URL 매핑은 다음과 같이 기대) 그리고 컨트롤러 이름은 SocialMediaCacheProxyController를 가리 키도록 첫 번째 문자에서 소문자 여야합니다.

당신은 당신을 위해 트릭을 할 것 명명 된 매핑 다음 매핑이 필요하지 않은 경우 :

class UrlMappings { 
    static mappings = { 
     "/mediaproxy"(controller:"socialMediaCacheProxy", action:"index") 
     "/"(view:"/index") 
     "500"(view:'/error') 
    } 
} 
2

당신의 이름 매핑 앞에 이상한 문자가 있습니다 : - 덕분에, 데이브