Open main menu

Wikibooks β

WebObjects/Web Applications/Development/Stateless Components

< WebObjects

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

 public boolean isStateless() {
   return true;

Chuck HillEdit

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 VeilletteEdit

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.