canofy 发表于 2013-1-29 07:45:46

jwebap应用

jwebap是一个监控的东东,具体的还不太清楚,在本地部署了一下,测试成功,具体的还有待应用。。。。。
增加jwebap.xml配置文件
<?xml version="1.0" encoding="UTF-8"?><jwebap><!--component--><component name="HttpComponent" type="org.jwebap.plugin.http.HttpComponent"><!--(ms) timings filter‘s over time --><property name='trace-filter-active-time'>-1</property><!-- max over-time trace size --><property name='trace-max-size'>1000</property></component><component name="MethodComponent" type="org.jwebap.plugin.method.MethodComponent"><property name='trace-filter-active-time'>-1</property><property name='trace-max-size'>1000</property><!--package name and class name that monitored by MethodComponent,e.g.: 'test.*;test.Test' , divided by ';'--><property name='detect-clazzs'>test.*;</property></component><component name="JdbcComponent" type="org.jwebap.plugin.jdbc.JdbcComponent"><property name='trace-filter-active-time'>-1</property><property name='trace-max-size'>1300</property><property name='connection-listener'><!--Connection Listener-->org.jwebap.plugin.http.ServletOpenedConnectionListener;org.jwebap.plugin.method.MethodOpenedConnectionListener</property><!--1)Local datasource: jdbc driver class ,like oracle.jdbc.driver.OracleDriver;com.mysql.jdbc.Driver, divided by ';'.2)JNDI datasource: If your application uses jndi datasource, you can set the class which manages connections in your application as driver, e.g.: 'com.china.telecom.ConnectionManager'. DBComponent will inject this class to proxy all connectionthe class’s method return.--><property name='driver-clazzs'></property></component><!--dispatcher--><dispatcher name="RedirectDispatcher" mapping="" type="org.jwebap.ui.controler.DefaultRedirectDispatcher"/><dispatcher name="ActionDispatcher" mapping="/console/*" type="org.jwebap.ui.controler.ActionDispatcher"/><dispatcher name="ResourceDispatcher" mapping="/resources/*" type="org.jwebap.ui.controler.ResourceDispatcher"/><!--action-mapping--><action-mapping><action path="/" type="org.jwebap.ui.action.ConsoleAction" template="resources/view/index.ctl" /><!--HttpComponent--><action path="/http/tracer" component="HttpComponent"type="org.jwebap.plugin.http.TracerAction" template="resources/view/http_tracer.ctl" /><action path="/http/tracer/datas" component="HttpComponent"type="org.jwebap.plugin.http.TraceDatasAction"/><action path="/http/tracer/clear" component="HttpComponent"type="org.jwebap.plugin.http.TracesClearAction"/><action path="/http/stat" component="HttpComponent"type="org.jwebap.plugin.http.StatAction" template="resources/view/http_stat.ctl" /><action path="/http/stat/datas" component="HttpComponent"type="org.jwebap.plugin.http.StatDatasAction"/><!--MethodComponent--><action path="/method/tracer" component="MethodComponent"type="org.jwebap.plugin.method.TracerAction" template="resources/view/method_tracer.ctl" /><action path="/method/tracer/datas" component="MethodComponent"type="org.jwebap.plugin.method.TraceDatasAction"/><action path="/method/tracer/clear" component="MethodComponent"type="org.jwebap.plugin.method.TracesClearAction"/><action path="/method/stat" component="MethodComponent"type="org.jwebap.plugin.method.StatAction" template="resources/view/method_stat.ctl" /><action path="/method/stat/datas" component="MethodComponent"type="org.jwebap.plugin.method.StatDatasAction"/><!--JdbcComponent--><action path="/jdbc/tracer" component="JdbcComponent"type="org.jwebap.plugin.jdbc.TracerAction" template="resources/view/jdbc_tracer.ctl" /><action path="/jdbc/tracer/datas" component="JdbcComponent"type="org.jwebap.plugin.jdbc.TraceDatasAction"/><action path="/jdbc/tracer/clear" component="JdbcComponent"type="org.jwebap.plugin.jdbc.TracesClearAction"/></action-mapping></jwebap>

在web.xml配置文件中增加:
<context-param><param-name>config</param-name><param-value>/WEB-INF/jwebap.xml</param-value></context-param><listener><listener-class>org.jwebap.core.JwebapListener</listener-class></listener><filter><filter-name>PageDetectFilter</filter-name><filter-class>org.jwebap.plugin.http.DetectFilter</filter-class><init-param><param-name>excludeUrls</param-name><param-value>/detect;/detect/*;*.js;*.jpg;*.htm;*.html;*.gif;*.png;*.css;*.swf</param-value></init-param></filter><filter-mapping><filter-name>PageDetectFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping><servlet><servlet-name>detect</servlet-name><servlet-class>org.jwebap.ui.controler.JwebapServlet</servlet-class></servlet><servlet-mapping><servlet-name>detect</servlet-name><url-pattern>/detect/*</url-pattern></servlet-mapping>
最后通过http://localhost/detect/进行访问。
页: [1]
查看完整版本: jwebap应用