Giter Site home page Giter Site logo

groovy-web-console's Introduction

groovy-web-console

background

it is a tool to access java class at runtime. it can invoke spring bean, ibatis dao ,hibernate dao dynamically

this characteristic make it very useful to debug online. when a java project deploy online , it is very difficult to access its inner component. so when a bug occur ,it is difficult to find exact failure point. in my company, in order to solve this problem ,people always add log code and redeploy the project and monitor the log. this way is so time-consuming and ineffective.

so i create this java web console to solve the problem. when a bug occur , i invoke all the required beans and check the result one by one then the exact failure point found.

the main tech behind this tool is groovy , it can compile and run java code or groovy script at runtime.

install

1.download the jar file and put it in right place if you use maven ,then intall this jar file to you local repository by this commond , and add the following dependency section to you project pom file

if you donn't use maven then just put the jar file in "WEB-INF/lib" directory

2.put the following servlet declare section to your web.xml file

<!--  webconsole -->
<servlet>
	<servlet-name>groovyWebConsole</servlet-name>
	<servlet-class>com.yihaodian.sby.console.ConsoleAction</servlet-class>
	<init-param>
	        <param-name>ipAuth</param-name>
	        <param-value>127.0.0.1</param-value><!-- regex  -->
     	</init-param>

	        <init-param>
	        <param-name>envAuth</param-name>
	        <param-value>xxx=yyy</param-value>
                    <!--  xxx is the java envi key , and is a string 
                          yyy is xxx's java envi value , yyy is a regex can match multiple evn --->
     	</init-param>
</servlet>
<servlet-mapping>
	<servlet-name>groovyWebConsole</servlet-name>
	<url-pattern>/groovyWebConsole/*</url-pattern>
</servlet-mapping>

3.that is all and enjoy the groovy web console

usage

the groovy web console is just a embeded groovy script interpreter. so it can do all the thing that a groovy interpreter commond line do . the main difference are tow : groovy web console has a web interface and it can access spring or ibatis bean , so you can dynamically chech whether a bean behave the right way .

  • open you browser and input the url http://127.0.0.1/groovyWebConsole your url can be a little different from this one,if your project is not the root project .
  • input some groovy script and hit submit and you will get the script result

groovy-web-console's People

Contributors

loveczp avatar

Watchers

 avatar  avatar

Forkers

frankelau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.