Re: @StrutsParameter

Prasanth <[email protected]> Thu, 25 Sep 2025 14:57:44 -0500
Newsgroups gmane.comp.jakarta.struts.user
Message-ID <[email protected]>
--------------MbZl9kX4FjmZSd0MX8bw0mFs
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

See below, from migration guide. Based on the below everything other than classes you have defined should have @StrutsParameter on setXXX.  The only exceptions I found so far are Maps and Vectors.

|----------------------------------------|
When upgrading to Struts 7.0, adding the necessary annotations to all setter methods can be scripted using a RegEx find and replace on all files matching |*Action.java|.

Find: |\n(\h*public void set[A-Z]\w*\((long|Long|int|Integer|String|double|Double|Object|Number|Character|char|Float|float|List|Collection|Set|Date|LocalDateTime|Calendar|File))|

Replace: |\n    @StrutsParameter\n$1
----------------------------------------|

Thanks,
Prasanth

On 9/25/25 2:24 PM, Ute Kaiser wrote:
> I would also appreciate some more information on this.
> I use annotated public declarations on Strings, int, long without explicit getter/setter, but for objects I spread around with annotations on both getter and setter since I have not found out yet which is the right one to annotate for different scenarios.
> For displaying, it seems ok to use public declarations on everything,
> but when save with validations is needed, I struggle with lost values and „no access“ errors
> Best regards Ute
>
> Von meinem iPad gesendet
>
>> Am 25.09.2025 um 19:09 schrieb Prasanth<[email protected]>:
>>
>> Yeah, the code works. Even when it was a Boolean inside the Vector @StrutsParameter had to be used on getXXX method. So I assume that irrespective of the object type inside the Vector we have to annotate the getXXX method for Vectors.
>>
>> Thanks,
>> Prasanth
>>
>>> On 9/25/25 11:59 AM, Dave Newton wrote:
>>>> On Thu, Sep 25, 2025 at 11:24 Prasanth<[email protected]> wrote:
>>>>
>>>> public Vector<String> getDistributionAmounts()
>>> …
>>>
>>>> public void setContacts(ArrayList<Long> contacts)
>>>>
>>>> As you can see above which method (getXXX/setXXX) has to be annotated is
>>>> changing between Vector and ArrayList.
>>> It also changes the generic type; did it work with strings?
>>>
>>> d
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:[email protected]
>> For additional commands, e-mail:[email protected]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:[email protected]
> For additional commands, e-mail:[email protected]
>
>

--------------MbZl9kX4FjmZSd0MX8bw0mFs--