Forums Register Login

processRequest and render

+Pie Number of slices to send: Send
I have seen few samples using processRequest and render independently. In few examples, both co-exist.
Can someone explain me when to use processRequest and render?
What is the exact difference between them?

For example, I have a search form in which i enter a cust id. This should get me the details from the db and i have to display it in the next screen. There i can add a message and save it back to the db. Which method is appropriate in both the scenarios here?

Any help would be very much appreciated.
+Pie Number of slices to send: Send
Hello!

Both methods belong to the javax.portlet.Portlet interface, which describes the life cycle of a portlet in JSR 168. And both of them are used to handle requests:

processAction()
Called after the user submits changes to a portlet. Intended to process input from a user action.

render()
Called whenever the portlet is redrawn by the desktop.

Therefore in every non trivial portlet component you use both of them.

Greetings, Stefan
+Pie Number of slices to send: Send
"Padmanaban"-
Welcome back to the JavaRanch! Please take a sec to adjust your display name to match the JavaRanch Naming policy. Basically you need to have a first and last name. You can tweak it here.

Thanks!

- Jess
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1153 times.
Similar Threads
processRequest(..) + render(..)
Issue with Chinese characters in linux environment with Sql Server 2005
Rendering webpage based on request recieved from MobileBrowser/SystemWebBrowser
Why does it die after init()?
Getting the Servlet output in a JSP file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:51:10.