On 4/5/2022 9:41 PM,
e.d.pro...@gmail.com wrote:
>> I believe that as usual consistency is more important than what is
>> chosen.
>>
>> I would:
>> * use the Spring annotations for Spring web services as that is the
>> standard for those
>> * decide on either web.xml or @WebServlet for anything not Spring web
>> service
> Consistency is the first issue, as I pulled together decades of old
> code into one clean maven project with many modules. Some modules
> create wars, some create jars. Two of the war modules have spring
> framework config files. I'm wondering if we'll see benefits in
> setting all modules up for Spring, as we're modifying literally all
> the code anyway doing linting and unit tests, or if it makes any
> sense to use all Spring controllers in 2 modules and clean the rest
> up with a different style. There's literally one class using the
> servlet-mapping servlet, I don't see any upside to that syntax, the
> rest that aren't Spring are using WebServlet. All I know is the
> different syntax, I'm not aware of functional or performance benefits
> of any style choice.
If you only have one servlet using web.xml then I would change that
to annotation. There should not be any runtime performance difference
after startup. I don't remember if the annotations support all the
functionality in web.xml, but if the annotation support the
functionality you need then you are good.
Regarding cleanup - are you planning to stay on servers
(Tomcat or JBoss or whatever) or are you planning on moving
entirely to SpringBoot or are you planning to do both?
That may influence the road forward a lot.
Arne