Child pages
  • Development-Stateless Components

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Implement isStateless in your WOComponent and you will be able to manage the state yourself:

Code Block
public boolean isStateless() {
  return true;
}

Chuck Hill

There is some fairly OK information on stateless and nonsynchronizing components in Practical WebObjects. In a nutshell you need to use valueForBinding/setValueForBinding to access bound values and implement a public void reset() method that nulls all instance variables. This often requires design changes to your component.

Jean-François Veillette

Sometimes for stateless component, you need to keep variables values between the 3 phases, from takeValueFromRequest all the way to appendToResponse. Since ivars in a stateless component can't handle this case (reset() will be called after each phase), you have to store the information somewhere. Just use context.userInfo dictionary, and put whatever value in there. As the name imply, the value will only be good for this request only.