POST Entity to Portal Controller

How to post an entity from edit view to Portal Controller
There is a controller with method type POST, but what is the command to send ?

I have application-edit form of Application entity

I have portal controller which redirects to html template
what Portal Controller expects is Application entity

@RequestMapping(value = "/template")
    public String renderApplication(@RequestBody Application application) { ... }

I don’t know how to post Application entity from applicetion-edit view

What is your “edit view”? What technologies do you use for writing it?

Thanks for response, @gorbunkov

My edit view is Generic UI editor view, which is generated from Cuba studio for Application (Anketa) entity

Then probably you don’t need MVC controllers. Take a look at the Organizing Business Logic chapter from the manual. Maybe middleware services or some other approach described in this chapter is what you’re looking for.
Also, it may be useful to walk through the Bicycle Workhop step-by-step guide. It also contains examples of how to organize a business logic.

1 Like

I need to print entity to html without saving it - that’s why I am trying to POST it, and that’s why I think MVC is necessary

Bicycle Workshop is quite good, but still doesn’t contain any trick of unsaved entity template rendering

And my question is - Is it possible to send POST command with RequestBody from Generic UI ?

P.S. for now I am saving it into database with DRAFT status and retrieving in controller by its id

I still don’t understand your task, but anyway, from any place of your code you can use any Java library. Send HTTP requests with Apache Http Components ( or any other lib you like.