Setting the statuscode for the response in a directAction
Setting the statuscode for the response in a directAction
- Subject: Setting the statuscode for the response in a directAction
- From: Kaj Hejer <email@hidden>
- Date: Sun, 19 Dec 2004 19:46:11 +0100
Hi!
I have a directAction where I want to set the statuscode:
public WOActionResults invalidPageAction() {
WOComponent errorPage = pageWithName("MyInvalidPage");
System.out.println("context().response(): " +
context().response());
//
errorPage.context().response().setStatus(WOMessage.HTTP_STATUS_NOT_FOUND
); // gives a NPE
return errorPage;
}
The problem here is that context().response() and
errorPage.context().response() is null, so I don't have a reponseobject
to set the statuscode on.
Ofcource I could do this in appendToResponse in MyInvalidPage, but it
would be nice to be able to set this in the directAction.
Any ideas?
TIA!
-Kaj :)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden