Java is fine as a programming language. Java as a web app more or less means Spring. And Spring means XML files and annotations which come with their own problems. Kind of an out of the pan and into the fire thing.
(alternatives like Vert.x, the less-annotation-heavy quarkus, etc).
For Java web dev I actually like Kotlin better - ktor is pretty nice.
First of all there is more to Java Web development than JEE and Spring, which in any case, other eco-systems don't have a mature answer for many of their deployment scenarios and cross system integrations.
XML is beautiful, there is yet a format that supports machine manipulation, IDE graphical tooling, comments, schema validation as XML.
Anyone that praises Rails will be right at home with XML and annotations magic.