cancel
Showing results for 
Search instead for 
Did you mean: 

Custom web.xml

dfernandezgonza
Champ in-the-making
Champ in-the-making
Hello, how can I override WEB-INF/web.xml  (for  Monitoring with  Javamelody)  I'd like to NOT change the original web.xml file, but rather provide a customized version outside of the .war

http://blyx.com/2010/09/13/monitoring-alfresco-con-javamelody/



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



thank you
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
Unfortunately, I don't think this is currently possible.

Jeff

balakram
Champ in-the-making
Champ in-the-making
Hi,

You can override. Please go to deployed files on web server that you are using. During this process, one pop window will be appear to ask you remove existing file click ok.

Thanks.

roberto_gomez
Champ in-the-making
Champ in-the-making
I think application web.xml can't be overriden; but you can configure javamelody tomcat-wide. Just modify ${catalina.base}/conf/web.xml instead of application's web.xml. In the filter-mapping put the url of the servlet you want monitorize.

 
    <filter-mapping>
        <filter-name>monitoring</filter-name>
        <url-pattern>/servlet2/*</url-pattern>
    </filter-mapping>

Don't forget to add the javamelody.jar and other needed libraries to ${catalina.base}/lib. For instance, if you are monitoring spring jdbc you also need to add spring libraries.