Change the URL mapping -Javamelody

守給你的承諾、 提交于 2019-12-10 19:55:21

问题


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:


<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>


来源:https://stackoverflow.com/questions/15803638/change-the-url-mapping-javamelody

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!