
|
If you were logged in you would be able to see more operations.
|
|
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
None
|
|
I am testing the new name for parameters in the StrutsUseCaseForm. I had seen that now the name has the action name as prefix. I think this is great, but now I had found a inconsistency on the StrutsController.vsl:
In the operations definition the template does:
$visibility final $returnType ${operation.name}(ActionMapping mapping, $formBeanClassName form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
#foreach ($parameter in $parameters)
#if ($parameter.date)
final $parameter.type.fullyQualifiedName $parameter.name = form.${parameter.getterName}AsDate();
#else
final $parameter.type.fullyQualifiedName $parameter.name = form.${parameter.getterName}();
#end
#end
(I had added the Date discrimination so it compile Ok, but anyway this is not the problem)
On the other hand on the populate form method you have:
private void populateForm($formBeanClassName form)
{
#foreach ($field in $useCase.formFields)
#if ($field.table)
form.${field.setterName}(${field.name}DummyList);
#elseif ($field.date)
form.${field.setterName}AsDate($field.resetValue);
#else
form.${field.setterName}($field.resetValue);
#end
#if ($field.backingListPresent)
#set ($backingListName = $field.backingListName)
#set ($backingListMethod = $str.upperCaseFirstLetter($backingListName))
form.set${backingListMethod}($field.backingListResetValue);
#end
#end
}
In one place you are accesing the names of the attributes on the controller, which do not have the name of the action as parameters, on the other hand, you are using the parameters from the useCase, so this do have the action name as preffix.
For this reason now, when defining the names of the parameters on the controller, if the name of the action is not written before the name of the parameter, it does not compile Ok.
I think that the name of the parameter on the actions method should be taken from the UseCaseformFields intead of the name of the controller...
|
|
removed all related template code, this cannot be unambiguously fixed
|
|