2013-12-18 60 views
0

發現我已經把到模塊我index.gsp的Grails 2.3 - [錯誤]沒有與名稱

ApplicationResources.groovy

modules = { 
    application { 
     resource url:'js/bootstrap.js' 
    } 
} 

但是我得到的錯誤:

[http-bio-8080-exec-8] ERROR [/testApplication].[gsp] - Servlet.service() for servlet [gsp] in context with path [/testApplication] threw exception 
Message: Error mapping onto view [/index]: Error processing GroovyPageView: Error executing tag <g:javascript>: No module found with name [bootstrap.js] 
    Line | Method 
->> 53 | doFilter in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|  49 | doFilter in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter 
|  82 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run  in java.lang.Thread 
Caused by GroovyPagesException: Error processing GroovyPageView: Error executing tag <g:javascript>: No module found with name [bootstrap.js] 
->> 530 | doFilter in C:\Users\user\GrailsWorkspace\testApplication\grails-app\views\index.gsp 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Caused by GrailsTagException: Error executing tag <g:javascript>: No module found with name [bootstrap.js] 
->> 150 | doCall in C:/Users/user/GrailsWorkspace/testApplication/grails-app/views/index.gsp 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Caused by IllegalArgumentException: No module found with name [bootstrap.js] 
->> 1032 | getAllModuleNamesRequired in org.grails.plugin.resource.ResourceProcessor 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1091 | addModuleDispositionsToRequest in  '' 
| 144 | declareModuleRequiredByPage in org.grails.plugin.resource.ResourceTagLib 
| 330 | doCall in org.grails.plugin.resource.ResourceTagLib$_closure5_closure20 
| 326 | doCall . in org.grails.plugin.resource.ResourceTagLib$_closure5 
| 150 | doCall in C__Users_user_GrailsWorkspace_testApplication_grails_app_views_index_gsp$_run_closure2 
| 152 | run . . . in C__Users_user_GrailsWorkspace_testApplication_grails_app_views_index_gsp 
|  53 | doFilter in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter 
|  49 | doFilter in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter 
|  82 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter 
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 603 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 722 | run . . . in java.lang.Thread 

我也嘗試grails clean。但是它不會改變我的輸出。

我真的很感謝你的回答我的問題

回答

2

請注意,你已經把它正在申請

application { 
     resource url:'js/bootstrap.js' 
    } 

<g:javascript library="application"/> 

應工作

或者把這個在您的ApplicationResource.groovy

mydef { 
      resource url:'js/bootstrap.js' 
     } 

和這個在你的gsp頁面(或主版面pag e)

<g:javascript library="mydef"/> 
相關問題