How to hide password fields from Grails scaffolding views?

前端 未结 1 1339
死守一世寂寞
死守一世寂寞 2021-01-28 00:20

According to the docs, Grails provides a number of constraints that \"have no impact on persistence but customize the scaffolding\". One of them is the passwordcons

相关标签:
1条回答
  • 2021-01-28 01:01

    One way to solve this is by using customized field rendering via the fields plugin:

    • Create a folder grails-app\views\_fields\user\password
    • Put two files in this folder: _displayWidget.gsp and _displayWrapper.gsp
    • Enter <g:each in="${0..value.length()}">&bull;</g:each> into both files

    The password field will not vanish from index and show views, but at least you won't see it's value any longer, but a mask of bullet points instead. Create and edit view still use the password input widget according to the property constraint.

    0 讨论(0)
提交回复
热议问题