Re: Migration from 6 to 7 and form class
Prasanth <[email protected]> Thu, 10 Apr 2025 14:51:22 -0500
| Newsgroups | gmane.comp.jakarta.struts.user |
|---|---|
| Message-ID | <[email protected]> |
Looks like I have to annotate the get method rather than the set method when there is a form class for an action. Also I had to change the depth to 2 when I have an array list in the form class.
Thanks,
Prasanth
On 4/10/25 11:08 AM, Prasanth Pasala wrote:
> Hi,
>
> I am migrating a project from Struts 6.7.4 to 7.0.3. We have a form where the form fields are as show below, the reallocation form class is added to the struts.allowlist.classes so no warnings about
> it in the log. The setReallocationForm is also tagged with StrutsParameter. The set method is getting called but the details in the form are not populated. Just to try, added @StrutsParameter on the
> set methods in ReallocationForm too but that did not help either. Anything else I should be doing to get the fields inside the reallocationForm object to be populated by struts?
>
> <input id="Reallocation_reallocationForm_transactionType0" name="reallocationForm.transactionType" type="radio" value="0">
> <input id="Reallocation_reallocationForm_pageNumber" name="reallocationForm.pageNumber">
>
> @StrutsParameter(depth = 1)
> public void setReallocationForm(ReallocationForm reallocationForm) {
> this.reallocationForm = reallocationForm;
> }
>
> Thanks,
> Prasanth