Change the URL mapping -Javamelody

2019-07-06 00:00发布

I'm using Javamelody in my application. I need only root users to access the statistics. Javamelody by default you can access

http://localhost/webapp/monitoring

I need to change it to

http://localhost/webapp/monitor/monitoring

I have done the following filter mapping

<filter>
    <filter-name>monitoring</filter-name>
    <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>monitoring</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
    <listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>

1条回答
可以哭但决不认输i
2楼-- · 2019-07-06 00:30
<filter>
        <filter-name>monitoring</filter-name>
        <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
        <init-param>
                <param-name>monitoring-path</param-name>
                <param-value>/admin/monitoring</param-value>
        </init-param>
</filter>
查看更多
登录 后发表回答