Grails, finding available views (.gsp's) at runtime -


An easy way for a grails app to find available list of ideas available (* .gsp) at run-time is.

Ideally, a solution will work for both ARP servers that open the war and do not unpack the war.

Thanks

Unfortunately this god is different for the environment and when in war Deployed:

  import org.codehaus.groovy.grails Web.context.ServletContextHolder as SCH def gsps = [] if (grailsApplication.isWarDeployed ()) {findWarGsps' / WEB {File (file in new file) for {0} - {0} (if) - {if (File.path.endsWith ('gsp')) {GSPS & lt; & Lt; File.path - 'grails-app / views /'} Other {findDevGsps file.path, gsps}}} Private Zero Search Virus (Current, GPS) {def servletContext = for SCH.servletContext (servletContext.getResourcePaths (current) Path) {If (path.endsWith ('.gsp')) {GSPS & lt; & Lt; Path - '/ web-INF / gyle-app / visual /'} other {search, gps, gps}}}  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -