سؤال

I want to delegate to Spring automatic mapping of HTML FORM fields to my model class. Is it possible?

I have a method:

@ActionMapping(params = "action=actionOne")
public void actionOne(ActionRequest request, ActionResponse response) {    
}

This method processes the form submitting. And I want to create class like Document and I want automatic mapping of form fields to Document class. How to done this with Spring Portlet MVC?

هل كانت مفيدة؟

المحلول

You need to use Spring form Tag.

Refer this.

And change your Controller appropriately

@ActionMapping(params = "action=actionOne")
public void actionOne( (@ModelAttribute("document") Document document, ActionRequest request, ActionResponse response) {    
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top