Is it possible to use immutable class in Struts2 form? -


situation: moving using struts 1 struts 2. in struts 1, necessary form classes follow javabean specification. since business data objects immutable, required creating javabean version of many classes, , methods mapping between two.

does struts2 support using immutable objects forms?

if so, how configure such immutable object instantiated builder using form fields?

the object being populated request can't immutable, because ognl calls setters on it–that's how ognl (and els) work.

i figure have 2 options: either custom parameters interceptor, or create constructor or builder takes bean used form.

without real thought, i'd latter, although might create quick tool generate form classes if there lot of them. interceptor more elegant, it'd need use reflection.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -