{"id":71343,"date":"2017-12-12T19:00:24","date_gmt":"2017-12-12T17:00:24","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=71343"},"modified":"2019-02-14T13:18:50","modified_gmt":"2019-02-14T11:18:50","slug":"adding-lite-groovy-web-console-grails-war","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html","title":{"rendered":"Adding a \u201clite\u201d Groovy web console to a Grails war"},"content":{"rendered":"<p>Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source then you can view <code>Config.groovy<\/code>, <code>BuildConfig.groovy<\/code>, etc. (in this case I\u2019m talking about a Grails 2 app but these ideas are generalizable to Grails 3+) but that\u2019s often not enough.<\/p>\n<p>Grails 2 supports external configuration files, which can be in various places and get merged into the final configuration. But just having what you think is the correct source and configuration files isn\u2019t enough since changes could have been made that didn\u2019t make it into source control. And you can\u2019t easily get information from those files in a WAR since they\u2019re compiled into classes.<\/p>\n<p>My preference for digging into a running Grails application is the <a href=\"http:\/\/grails.org\/plugin\/console?skipRedirect=true\" target=\"_blank\" rel=\"noopener\">console plugin,<\/a>\u00a0but to use that you would need to add it to <code>BuildConfig.groovy<\/code> and build and deploy a new WAR, but again that\u2019s not necessarily going to have the same configuration as the previous deployment.<\/p>\n<p>I have a situation like this at <a href=\"https:\/\/avillach-lab.hms.harvard.edu\" target=\"_blank\" rel=\"noopener\">work,<\/a>so I came up with a lightweight way to add a web-based console similar to the console plugin to a WAR. Originally it was a servlet which generated the HTML for a simple form containing a textarea for Groovy code and a submit button to post the code to be run on the server, and the logic (mostly borrowed from the console plugin) to execute the code and return the results to the browser. I compiled it in the same project that the WAR was built from to ensure that it\u2019s compatible with the versions of Groovy, Grails, Spring, etc. and copied the .class file to <code>WEB-INF\/classes<\/code> in the exploded directory in Tomcat\u2019s <code>webapps<\/code> folder, and manually edited <code>WEB-APP\/web.xml<\/code> to add the required <code>&lt;servlet&gt;<\/code> and <code>&lt;servlet-mapping&gt;<\/code> elements, and everything worked great in my small test app.<\/p>\n<p>But when I tried it in the real application I couldn\u2019t access it because of Spring Security. In this particular case I could have worked around that because the app stores <code>Requestmap<\/code> instances in the database, but I didn\u2019t want to make changes that I might forget to undo, and there\u2019s the chicken-and-egg problem that I don\u2019t necessarily know what the database settings are for this deployment. So instead I converted the servlet to a servlet filter, and made sure to add the filter before the Spring Security filter chain in <code>web.xml<\/code> and it worked as expected after restarting the server.<\/p>\n<p>I made the changes in the exploded war directory, but it\u2019s also possible to make the changes in the WAR file itself. Since WAR files are ZIP files, you can unzip the WAR, make the changes, and re-zip.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Here\u2019s the source for the filter:<\/p>\n<pre class=\"brush:java\">package com.burtbeckwith.hack\n\nimport groovy.transform.CompileStatic\nimport groovy.util.logging.Slf4j\nimport org.codehaus.groovy.grails.commons.GrailsApplication\nimport org.springframework.context.ApplicationContext\nimport org.springframework.web.context.support.WebApplicationContextUtils\n\nimport javax.servlet.Filter\nimport javax.servlet.FilterChain\nimport javax.servlet.FilterConfig\nimport javax.servlet.ServletException\nimport javax.servlet.ServletRequest\nimport javax.servlet.ServletResponse\nimport javax.servlet.http.HttpServletRequest\nimport javax.servlet.http.HttpServletResponse\n\n@CompileStatic\n@Slf4j\nclass HackFilter implements Filter {\n\n   private ApplicationContext applicationContext\n   private GrailsApplication grailsApplication\n\n   void init(FilterConfig fc) throws ServletException {\n      applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(fc.servletContext)\n      grailsApplication = applicationContext.getBean(GrailsApplication)\n   }\n\n   void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {\n      HttpServletRequest request = (HttpServletRequest) req\n      HttpServletResponse response = (HttpServletResponse) res\n\n      if ('GET' == request.method) {\n         doGet request, response\n      }\n      else {\n         \/\/ assume POST\n         doPost request, response\n      }\n   }\n\n   void destroy() {}\n\n   private void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n      response.writer.write html(request.contextPath)\n   }\n\n   private void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n      long startTime = System.currentTimeMillis()\n\n      String code = request.getParameter('code')\n\n      ByteArrayOutputStream baos = new ByteArrayOutputStream()\n      PrintStream out = new PrintStream(baos)\n      PrintStream systemOut = System.out\n\n      Throwable e\n      String result = ''\n      try {\n         System.out = out\n         result = new GroovyShell(grailsApplication.classLoader, new Binding(\n               config: grailsApplication.config,\n               ctx: applicationContext,\n               grailsApplication: grailsApplication,\n               out: out,\n               request: request,\n               session: request.session)).evaluate(code)\n      }\n      catch (Throwable t) {\n         e = t\n      }\n      finally {\n         System.out = systemOut\n      }\n\n      if (e) {\n         StringWriter sw = new StringWriter()\n         e.printStackTrace new PrintWriter(sw)\n         result = sw.toString().replace('\\t', '   ').replace(System.getProperty('line.separator'), '&lt;br\/&gt;\\n')\n      }\n\n      response.writer &lt;&lt; html(request.contextPath, code, \"\"\"\\\nTotal time: ${System.currentTimeMillis() - startTime}ms\n\nStdout:\n${baos.toString('UTF8')}\n\n${e ? 'Exception' : 'Result'}:\n$result\"\"\")\n   }\n\n   private String html(String contextPath, String code = '', String results = '') {\n      \"\"\"\\\n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;Hack&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n   &lt;form action=\"$contextPath\/hack\" method=\"POST\"&gt;\n      &lt;span&gt;Code: (binding vars include &lt;i&gt;config&lt;\/i&gt;, &lt;i&gt;ctx&lt;\/i&gt;, &lt;i&gt;grailsApplication&lt;\/i&gt;, &lt;i&gt;out&lt;\/i&gt;, &lt;i&gt;request&lt;\/i&gt;, &lt;i&gt;session&lt;\/i&gt;)&lt;\/span&gt;&lt;br\/&gt;\n      &lt;textarea name=\"code\" cols=\"120\" rows=\"25\"&gt;$code&lt;\/textarea&gt;&lt;br\/&gt;\n      &lt;input type=\"submit\" value=\"Execute\" name=\"execute\" \/&gt;&lt;br\/&gt;\n      &lt;span&gt;Results:&lt;\/span&gt;&lt;br\/&gt;\n      &lt;textarea name=\"results\" cols=\"120\" rows=\"25\" disabled=\"disabled\"&gt;$results&lt;\/textarea&gt;\n   &lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n\"\"\"\n   }\n}<\/pre>\n<p>and these are the corresponding <code>&lt;filter&gt;<\/code> and &lt;filter-mapping&gt; elements for <code>web.xml<\/code>:<\/p>\n<pre class=\" brush:xml\">&lt;filter&gt;\n   &lt;filter-name&gt;hack&lt;\/filter-name&gt;\n   &lt;filter-class&gt;com.burtbeckwith.hack.HackFilter&lt;\/filter-class&gt;\n&lt;\/filter&gt;\n&lt;filter-mapping&gt;\n   &lt;filter-name&gt;hack&lt;\/filter-name&gt;\n   &lt;url-pattern&gt;\/hack&lt;\/url-pattern&gt;\n&lt;\/filter-mapping&gt;<\/pre>\n<p>To access the console, navigate to http:\/\/server:port\/contextPath\/hack. As in the console plugin you can run arbitrary Groovy code (including service method calls, working with domain classes, etc.), and there are several objects in the Binding that you can use \u2013 <code>config<\/code>, <code>ctx<\/code>, <code>grailsApplication<\/code>, <code>out<\/code>, <code>request<\/code>, and <code>session<\/code>.<\/p>\n<p>To change the uri from \/hack to something else, be sure to update both the <code>&lt;url-pattern&gt;<\/code> tag in <code>web.xml<\/code> and the <code>action<\/code> attribute in the generated form in the filter class.<\/p>\n<p><a title=\" Adding a \u201clite\u201d Groovy web console to a Grails war\" href=\"http:\/\/burtbeckwith.com\/blog\/?p=2460\" rev=\"flattr;uid:burtbeckwith;language:en_GB;category:software;tags:blog;\">Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source then you&#8230;<\/a><\/p>\n<p>This entry was posted on Thursday, December 07th, 2017 at 8:23am and is filed under <a href=\"http:\/\/burtbeckwith.com\/blog\/?cat=19\" rel=\"category\">grails<\/a>, <a href=\"http:\/\/burtbeckwith.com\/blog\/?cat=18\" rel=\"category\">groovy<\/a>, <a href=\"http:\/\/burtbeckwith.com\/blog\/?cat=2\" rel=\"category\">java<\/a>, <a href=\"http:\/\/burtbeckwith.com\/blog\/?cat=20\" rel=\"category\">security<\/a>. You can follow any responses to this entry through the <a href=\"http:\/\/burtbeckwith.com\/blog\/?feed=rss2&amp;p=2460\">RSS 2.0<\/a> feed. You can <a href=\"#respond\">leave a response<\/a> (comments are moderated) or <a href=\"http:\/\/burtbeckwith.com\/blog\/wp-trackback.php?p=2460\">trackback<\/a> from your own site.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Java Code Geeks with permission by Burt Beckwith, partner at our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/burtbeckwith.com\/blog\/?p=2460\" target=\"_blank\" rel=\"noopener\">Adding a \u201clite\u201d Groovy web console to a Grails war<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source then you can view Config.groovy, BuildConfig.groovy, etc. (in this case I\u2019m talking about a Grails 2 app but these ideas are generalizable to Grails 3+) but that\u2019s &hellip;<\/p>\n","protected":false},"author":164,"featured_media":130,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[192],"class_list":["post-71343","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-grails"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Adding a \u201clite\u201d Groovy web console to a Grails war - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding a \u201clite\u201d Groovy web console to a Grails war - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-12T17:00:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-14T11:18:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/grails-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Burt Beckwith\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Burt Beckwith\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html\"},\"author\":{\"name\":\"Burt Beckwith\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/3cf04d9b0a49f04b2576c456befb2446\"},\"headline\":\"Adding a \u201clite\u201d Groovy web console to a Grails war\",\"datePublished\":\"2017-12-12T17:00:24+00:00\",\"dateModified\":\"2019-02-14T11:18:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html\"},\"wordCount\":665,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/grails-logo.jpg\",\"keywords\":[\"Grails\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html\",\"name\":\"Adding a \u201clite\u201d Groovy web console to a Grails war - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/grails-logo.jpg\",\"datePublished\":\"2017-12-12T17:00:24+00:00\",\"dateModified\":\"2019-02-14T11:18:50+00:00\",\"description\":\"Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/grails-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/grails-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/12\\\/adding-lite-groovy-web-console-grails-war.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Adding a \u201clite\u201d Groovy web console to a Grails war\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/3cf04d9b0a49f04b2576c456befb2446\",\"name\":\"Burt Beckwith\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b5c5b0ec9414f2f4efb0d842d2412851a737fd1da29f3edc67f43d201133b2f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b5c5b0ec9414f2f4efb0d842d2412851a737fd1da29f3edc67f43d201133b2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b5c5b0ec9414f2f4efb0d842d2412851a737fd1da29f3edc67f43d201133b2f?s=96&d=mm&r=g\",\"caption\":\"Burt Beckwith\"},\"sameAs\":[\"http:\\\/\\\/burtbeckwith.com\\\/blog\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Burt-Beckwith\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding a \u201clite\u201d Groovy web console to a Grails war - Java Code Geeks","description":"Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html","og_locale":"en_US","og_type":"article","og_title":"Adding a \u201clite\u201d Groovy web console to a Grails war - Java Code Geeks","og_description":"Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source","og_url":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-12-12T17:00:24+00:00","article_modified_time":"2019-02-14T11:18:50+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/grails-logo.jpg","type":"image\/jpeg"}],"author":"Burt Beckwith","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Burt Beckwith","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html"},"author":{"name":"Burt Beckwith","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/3cf04d9b0a49f04b2576c456befb2446"},"headline":"Adding a \u201clite\u201d Groovy web console to a Grails war","datePublished":"2017-12-12T17:00:24+00:00","dateModified":"2019-02-14T11:18:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html"},"wordCount":665,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/grails-logo.jpg","keywords":["Grails"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html","url":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html","name":"Adding a \u201clite\u201d Groovy web console to a Grails war - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/grails-logo.jpg","datePublished":"2017-12-12T17:00:24+00:00","dateModified":"2019-02-14T11:18:50+00:00","description":"Suppose you have a Grails application deployed to a server \u2013 how would you go about finding out how the application was configured? If you have the source","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/grails-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/grails-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2017\/12\/adding-lite-groovy-web-console-grails-war.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Adding a \u201clite\u201d Groovy web console to a Grails war"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/3cf04d9b0a49f04b2576c456befb2446","name":"Burt Beckwith","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3b5c5b0ec9414f2f4efb0d842d2412851a737fd1da29f3edc67f43d201133b2f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3b5c5b0ec9414f2f4efb0d842d2412851a737fd1da29f3edc67f43d201133b2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b5c5b0ec9414f2f4efb0d842d2412851a737fd1da29f3edc67f43d201133b2f?s=96&d=mm&r=g","caption":"Burt Beckwith"},"sameAs":["http:\/\/burtbeckwith.com\/blog\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Burt-Beckwith"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/71343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/164"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=71343"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/71343\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/130"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=71343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=71343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=71343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}