Stats

VRaptor comes with a default component capable of giving background information on VRaptor's configuration to the view component.

Registering StatsQuery

Just add the StatsQuery component to vraptor.xml:

        <component>org.vraptor.util.StatsQuery</component>

There is a StatsQuery/read.ok.jsp example in the mydvds application that you can download.

Here is a simple example that helps most beginner programmers:

<div id="blue-box" style="width: 700px;">

This feature is here only for demonstration. You should turn it off while live.<br/>
<br/>

<table style="width: 100%; border-style: solid; border-width: 1pt; border: solid 1pt; border-collapse: collapse;">
<tr>
        <td>Name</td>
        <td>Component class</td>
        <td>Interceptors</td>
        <td>Parameter</td>
        <td>Logics</td>
</tr>
<c:forEach var="component" items="${components}">
<tr>
        <td>${component.name}</td>
        <td>${component.componentClass.simpleName}</td>
        <td>
<c:forEach var="i" items="${component.interceptors}">
        - ${i.interceptorClass.simpleName}<br/>
</c:forEach>
        </td>
        <td>
<c:forEach var="p" items="${component.readParameters}">
        - ${p.key}<br/>
</c:forEach>
        </td>
        <td>
<c:forEach var="logic" items="${component.logics}">
        - ${logic.name} : ${logic.metadata.name}<br/>
</c:forEach>
        </td>
</tr>
</c:forEach>
</table>

<br/><br/>

<table style="width: 100%; border-style: solid; border-width: 1pt; border: solid 1pt; border-collapse: collapse;">
<tr>
        <td>Url</td>
        <td>Callback</td>
</tr>
<c:forEach var="component" items="${components}">
<c:forEach var="logic" items="${component.logics}">
<tr>
        <td>${component.name}.${logic.name}.logic</td>
        <td>${component.componentClass.name}.${logic.metadata.name}</td>
</tr>
</c:forEach>
</c:forEach>
</table>

</div>

Production systems

This feature should be disabled (do not register the component) in a live system: it can create a security lack if you leave your component registered as the end user might see what are the urls and read parameters.