• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

processRequest and render

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic