• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

processRequest and render

 
Padmanaban Jayabalan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stefan Zoerner
Author
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic