The first line should be [[[WOResponse alloc] init] autorelease].

Regardless, action methods should return objects that conform to the
response generation protocol-- see the end of WOResponse.h.  That means,
they should either be an instance of WOResponse or, more likely, some
WOComponent (i.e. invoke pageWithName:, set up the page according to the
action, then return it).

b.bum

On Wed, 24 Feb 1999, matt kangas wrote:

> Oooops, one little mistake in that last request:
> 
> > - (WOResponse *)helloAction {
> >     id aResponse = [WOResponse init];
> >     id d = @"<html><head></head><body> hello! </body></html>";
> >     [aResponse setContent:d];
> >     return aResponse;
> > }
> > 
> > checking out /cgi-bin/WebObjects/wa/hello gives us
> > 
> > Exception while evaluating WebScript expression [aResponse appendContentString:d]: 
> > Can't perform 'appendContentString:' on 'WOResponse': Selector is not
> > defined for that object
> 
> as you might expect, the error message really is
> 
> Exception while evaluating WebScript expression [aResponse setContent:d]: 
> Can't perform 'setContent:' on 'WOResponse': Selector is not defined for
> that object
> 
> (yes, i tried appendContentString too)
> 
> --
>  \7\3\d\e\k\b\8\u\o\x\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
> \m\a\t\t\.\k\a\n\g\a\s\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
> m\a\t\t\@\k\a\n\g\a\s\.\o\r\g\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
> 
> 

Reply via email to