-
1. Re: Conversion: String to Beans
nickarls Oct 15, 2009 7:33 AM (in response to bbviana)e.g. JSF and converters? Or did I miss the question?
-
2. Re: Conversion: String to Beans
bbviana Oct 15, 2009 3:07 PM (in response to bbviana)Yes, its about converters.
-
3. Re: Conversion: String to Beans
pmuir Oct 16, 2009 1:34 AM (in response to bbviana)No, conversion is not part of the spec. Seam did include a basic converter, as does EL and JSF.
We won't be adding it to Weld or the spec IMO.
-
4. Re: Conversion: String to Beans
gavin.king Oct 18, 2009 3:23 PM (in response to bbviana)Right, Weld won't include anything that is specific to a certain web framework (not even JSF). Conversion is the responsibility of your web framework.
-
5. Re: Conversion: String to Beans
cpopetz Oct 29, 2009 1:44 PM (in response to bbviana)I'm very happy that this is being left to the web frameworks. Weld's web framework agnosticism is awesome. Encoding/Decoding of web request params and management of encoding schemes (foo?x=y& vs /foo/x/y) is definitely not something I want my DI container handling.
-
6. Re: Conversion: String to Beans
dan.j.allen Oct 29, 2009 2:29 PM (in response to bbviana)This type of conversion is covered by JSF, and can be registered to take place automatically using view parameters, that is, if you are using JSF 2. You associate a name and EL binding with a page and each time there is a transition, the bean goes back and forth between string request parameter and object.
Now, would it be nice to have a declarative convertor, like bean validation is to validation? In most cases, converting to and from a string is easy. Dates come to mind as something that requires developer involvement.
@DatePattern("yyyy-mm-dd") public Date getStartDate() { return date; }
That would certainly be agnostic to JSF...something Wicket could consume, for instance.
Either way, it isn't a JSR-299 thing.