Question

I am calling a webpage from a portlet. The webpage is a form for user to enter data and has a button which submits the user data into Database. But the Button also redirects the portlet site to the webpage through the proxy Gateway. How to stay in the same portlet page while having the Form data submitted to the database?

Was it helpful?

Solution

You could use AJAX

OTHER TIPS

Just adding to the AJAX answer..

A standard JSR 286 portlet supports such asynchronous action through serveResource method in the portlet class, which you'll need to override.

In the java file,

public void serveResource(ResourceRequest request, ResourceResponse response)
throws PortletException, IOException {
  //Write or invoke your database code here...
}

Also, in the html <form> tag you will need to set <portlet:resourceURL> in the action attribute.

Hope this helps, even though I am assuming by portlet you mean Java portlets and not something else

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top