concept param in category java

This is an excerpt from Manning's book Struts 2 in Action.
The fileUpload interceptor creates a special version of the automatic data transfer mechanisms we saw earlier. With the previous data transfers, we were dealing with the transfer of form field data from the request to matching JavaBeans properties on our action objects. The params interceptor, also part of the defaultStack, was responsible for moving all of the request parameters onto the action object wherever the action provided a JavaBeans property that matched the request parameter’s name. In listing 3.10, you can see that the defaultstack places the fileUpload interceptor just before the params interceptor. When the fileUpload interceptor executes, it processes a multipart request and transforms the file itself, along with some metadata, into request parameters. It does this using a wrapper around the servlet request. Table 3.2 shows the request parameters that are added by this fileUpload interceptor.
After the fileUpload interceptor has exposed the parts of the multipart request as request parameters, it’s time for the next interceptor in the stack to do its work. Conveniently, the next interceptor is the params interceptor. When the params interceptor fires, it moves all of the request parameters, including those listed in table 3.2, onto the action object. Thus, all a developer needs to do to conveniently receive the file upload is add JavaBeans properties to her action object that match the names in table 3.2.
First, these will receive the automatic data transfer from the incoming request parameters. As we saw in chapter 4 this occurs because the params interceptor sets those parameters on properties exposed on the ValueStack, upon which the action object sits. While other things, such as the model of the ModelDriven interface, may also be placed on the stack, what all data on the ValueStack has in common is that it’s all specific to the application’s domain. In MVC terms, the ValueStack is the request’s view of the application’s model data. There are no infrastructural objects, such as Servlet API or Struts 2 objects, on the ValueStack. The action is only there because of its role as domain data carrier; it’s not there because of its action logic.
There are a few requirements on the object that can be used as a bean. As you might expect, the object must conform to JavaBeans standards by having a zero-argument constructor and JavaBeans properties for any instance fields that you intend to initialize with param tags. We’ll demonstrate all of this, including the use of param tags, shortly. First, table 6.5 details the attributes for the bean tag.
<s:bean name="org.apache.struts2.util.Counter" var="counter"> <s:param name="last" value="7"/> </s:bean> <s:iterator value="#counter"> <li><s:property/></li> </s:iterator>