The ParameterInfoProvider is responsible for providing parameter names from a component method, used to associate your request parameters with your logic method's parameter.
This means that given a method, it will come up with it's parameters names so VRaptor can call your logic's method with the appropriate parameters.
The default implementation takes the first letter of your parameter class name and lowercases it. (Calendar will be calendar, MyClass will be myClass).
You can override the default ParameterInfoProvider by implementing org.vraptor.component.ParameterInfoProvider interface and adding the following lines to your web.xml:
<context-param>
<param-name>
org.vraptor.component.ParameterInfoProvider
</param-name>
<param-value>org.vraptor.MyParameterInfoProvider</param-value>
</context-param>You can use the ParanamerParameterInfoProvider in order to allow VRaptor to make use of paranamer to read all your parameter variable names.
The problem with Java is that local variable names are "lost" during compilation time (if debug info is not added), therefore the Java Reflection API does not allow us to access those names.
In order to guess variable names like "int age" as age you need to compile your code with the -g option. Eclipse, for instance, does it by default.
In order to use the paranamer support, register it in your web.xml file:
<context-param>
<param-name>
org.vraptor.component.ParameterInfoProvider
</param-name>
<param-value>org.vraptor.component.ParanamerParameterInfoProvider</param-value>
</context-param>If you use maven 2 you can configure it using the example provided with mydvds from our repository:
<build>
<plugins>
<plugin>
<groupId>com.thoughtworks.paranamer</groupId>
<artifactId>paranamer-maven-plugin</artifactId>
<executions>
<execution>
<id>run</id>
<configuration>
<sourceDirectory>
${basedir}/src/main/java
</sourceDirectory>
<outputDirectory>
${basedir}/target/classes
</outputDirectory>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugins>
<build>