>> id aResponse = [WOResponse init];
That is not valid! You at least need [[WOReponse alloc] init]; You probably also want
an autorelease in there so that you dont leak.
However, I would much rather see you do something like:
- helloAction {
return [self pageWithName:@"HelloWorld";
}
You dont want to be hard coding HTML in your pages..
-dave
matt kangas wrote:
> thanks; [EMAIL PROTECTED] suggested the same and
> [EMAIL PROTECTED] recommended a make clean. i did both (not in
> that order) and the 1st question seems resolved.
>
> now, how do i make a "hello world" action?
> what i have is:
>
> - (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
>
> ?
>
> is this not a real WOResponse?
> what does "Selector not defined" mean in this context? (what selector?)
>
> (inquiring minds want to know)
>
> On Wed, 24 Feb 1999, David Scheck wrote:
>
> > Direct Actions need to inherit from WODirectAction. Do the following in
> > your .wos file
> >
> > @interface DirectAction : WODirectAction { }
> > @end
> >
> > @implementation DirectAction
> >
> > - defaultAction {
> > return [self pageWithName:@"Main"];
> > }
> >
> > @end
> >
> > matt kangas wrote:
> >
> > >...
> > > DirectAction.wos looks like this
> > >
> > > - defaultAction {
> > > return [self pageWithName:@"Main"];
> > > }
> > >
> > > * try to access this with
> > > http://localhost/cgi-bin/WebObjects/Foo.woa/wa/
> > >
> > > the result is:
> > >
> > > Application: Foo
> > > Error: NSInvalidArgumentException
> > > Reason: *** -[DirectAction _scope]: selector not recognized
> > >
> >
>
> --
> \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\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \