java - Binding headers with hyphens to Play framework forms -
we authenticate users of our web application via shibboleth. application built using play framework. want bind headers come shibboleth play form. according the documentation, data binding performed using spring.
usually, binding works. if have form model class like
public user { public string name; }
then binding form name
field match 2 fields automatically.
one header comes shibboleth of form shib-identity-provider
. i'd bind field of form model, hyphens not legal characters field names in java. there way can map header name legal java field name? applies more too, can configure data binding don't need use identical form field names , java class field names binding work?
you can create class different field names data binding.
for example can create case class shib
follow:
case class shib (provider: string)
and define data binding function play mapping
val formmapping = mapping( "shib-identity-provider" -> text )(shib.apply)(shib.unapply)
then in controller can bind data directly request. can implement custom reads
doing similar thing.
Comments
Post a Comment