Issue with setHTTPHeader

Hi Folks,

I have some issue with setHTTPHeader

Below is the code when url not found.

but when I dump prc scope in layouts or views above variables are not defining and getting 200 status code. When my code is like above prc scope is defining.

Can you please help whaether this is IIS issue or something else.

Thanks,
Anirudh

Try setting headers manually and verify, but it might seem to be an IIS issue.

getPageContext().getResponse().setStatus( javaCast( “int”, arguments.statusCode ), javaCast( “string”, arguments.statusText ) );

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

> when I dump prc scope in layouts or views above variables are not defining and getting 200 status code.

Are you aborting the request after you dump? If so, that would prevent ColdBox from actually using the status code you are setting. How are you checking the status code returned by your page?

Can you explain what you mean when you say “variables are not defined”? Do you mean prc.PageNotFound and prc.pageTitle? Firstly, where in your site is that code at? That should work in a handler or a view, but that code in a model would not work like you expect. Also, how and where are you checking for their existence?

Thanks!

~Brad