• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting the statuscode for the response in a directAction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Setting the statuscode for the response in a directAction
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: locking problem
  • Next by Date: Apache 2 Adaptor on RHEL3...Again...
  • Previous by thread: Re: locking problem
  • Next by thread: Re: Setting the statuscode for the response in a directAction
  • Index(es):
    • Date
    • Thread