Re: [morph-user] Adapting legacy request parameters into new POJO?
Brought to you by:
orangeherbert,
sgarlatm
From: Matt B. <gud...@gm...> - 2010-04-19 14:26:49
|
Hi, Mick. Now that we're in the proper forum, let me apologize for the state of Morph's documentation, but you can certainly appreciate the universal axiom that documentation is always the lowest priority for an OSS project, being the least fun of the necessary tasks. DelegatingCopier has most likely become SimpleDelegatingTransformer (SDT) in the net.sf.morph.transform.transformers package. Also, SDT's default constructor initializes it with a best-guess at an all-purpose set of delegate Transformers for a simple object graph. I would try one of those out of the box unless you already know you have very complex types to work with here. If these are all strings, you should pretty much be set. HTH, Matt On 4/19/10, Mick Knutson <mkn...@ba...> wrote: > I have an interesting issue I am trying to solve in a manageable way. > > I have a few dozen legacy JSP's that I am phasing out. But I have to do them > 1by1. Each page create a POST of ~12 named request parameters that are ALL > named different. VERY frustrating as there is no good convention. > > So, My thought is trying to create a Map for mapping the old names to the > new names for each POST: > Map reqParam = {"newName", "oldName"} > > Where I have a new POJO that has set/getNewName(..) > > > Then, somehow copying from these old request properties from my request > properties Map to the new one's in my new POJO. > > Once Mapped, I have no further use for the old names. > > > *Next Post:* > > Morph seems to have what I think I want, but I have spent the past few hours > trying to get a simple example working, and the docs are wrong. It referes > to many classes that doe not exist in the jar. > > I also can not seem to find any other good examples. Can you point any out > for me? > > > Specifically, this is missing: > > > <!-- the overall transformer we'll use to do the graph copy --> > <bean > id="graphTransformer" > class="net.sf.morph.transform.DelegatingCopier"> > <property name="components"> > <list> > <ref bean="personCopier"/> > <ref bean="vehicleCopier"/> > <ref bean="childrenCopier"/> > <ref bean="addressConverter"/> > </list> > </property> > </bean> > > *MISSING from the code: net.sf.morph.transform.DelegatingCopier* > > > > --- > Thank You… > > Mick Knutson, President > > BASE Logic, Inc. > Enterprise Architecture, Design, Mentoring & Agile Consulting > p. (866) BLiNC-411: (254-6241-1) > f. (415) 685-4233 > > Website: http://www.baselogic.com > Blog: http://www.baselogic.com/blog/ > Linked IN: http://linkedin.com/in/mickknutson > Twitter: http://twitter.com/mickknutson > Vacation Rental: http://tahoe.baselogic.com > --- > |