Long time spring framework user, new member as of today. I've searched around this forum and Google to an answer to my question without luck. I have an object (Enthusiast) that I am trying to populate using a custom property editor. I need to search the db with any of the given field values (email, facebook, twitter.. ECT) and return a result if there is one. The property editor works fine, but the problem revolves around the fields.
Heres what I have inside the controller
Here is my formCode:@InitBinder("activityForm") public void initBinder(WebDataBinder binder, HttpServletRequest request) { binder.registerCustomEditor(Enthusiast.class, new EnthusiastEditor(request, new Enthusiast())); }
The problem is I don't have a hidden input with the name enthusiast. If I add that hidden input the setAsText method fires and everything works as expected. Is there a way around this? I need to get the enthusiast record if there is one before the data binding from the form happens so I am not married to using a custom property editor.Code:<form action="/api/v2/activity" method="post"> <input type="hidden" name="enthusiast.email" value="foobar@baz.com" /> <input type="hidden" name="enthusiast.facebookId" value="90210" /> <input type="submit" value="Submit" /> </form>


Reply With Quote
.
