There is a database server and a portal with installed portlet. Portlet represents a view, divied to two parts. At the left side there is a navigation tree. When user clicks on tree nodes he gets information from the database server and portlet should display this information on the right side of the view.
On my assumption portlet view page contains javascript code, when user clicks on a tree node, then portlet sends request to the servlet, gets servlet response, parses it and updates the view.
Portlet view layout is displayed below:
If it were only servlet based application, then I would implement javascript calls from the page to the server, return json, parse it on the page and update the page representation.
But java portlets are a bit different and I did not find a way how to do that.
And my question is there a way to package a servlet with portlet in one *.war file and implement requests from portlet to this servlet. Portlet sends all requests to this servlet, then servlet accesses database server, and after that sends results to the portlet.
If the answer is "yes" - how can I do that. Because I tried to package servlet with portlet, but such portlet does not work.
If the answer is "no" - what is the best approach to implement this "data query->response->update view" sequence in a portlet?
Thank you.