How to access Spring 3 MVC validator results in JSP without using form taglib

前端 未结 3 495
暗喜
暗喜 2021-02-04 08:08

I have a simple Spring 3 MVC form using jsp taglibs. I need to add a class based on whether a field within the form has any errors associated with it or not. Here is a snipet

3条回答
  •  有刺的猬
    2021-02-04 08:46

    While this is a little more obscure I think it's simpler because it's a single line which is what it would be if I were just using scriplets like any sane Java dev should. Taglibs need to die die die die, then die some more. They are horrible and I can't believe Java devs still think they actually help and not waste our utter time. PHP developers laugh at us when we use those things.

提交回复
热议问题