Hi
We are developing web application using Castle Monorail RC3. We want
to create 404 error page. This page will contain dynamically created
sitemap. We have the following requirements for this page:
1. This page should be generated by action of some controller. For
example ErrorController.FileNotFound()
2. We want to avoid additional HTTP redirects and save original URL in
browser address line.
3. Also we want to show this page in case of
ControllerNotFoundException.
Our initial solution was to use Application error event handler. There
we caught last exception and check if it causes "404" error: exception
is ControllerNotFoundException or it is HttpException with 404 status.
And then we wanted to use Server.Transfer("~/Error/
FileNotFound.rails"). But this call fails with exception "Error
executing child request for /Error/FileNotFound.rails."
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, Boolean setPreviousPage,
VirtualPath path, VirtualPath filePath, String physPath, Exception
error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(String path, TextWriter
writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Transfer(String path, Boolean
preserveForm)
at System.Web.HttpServerUtility.Transfer(String path)
After analisys of the System.Web.HttpServerUtility.ExecuteInternal
method in the Reflector we came to the conclusion that this method can
process only those handlers which are descendants of StaticFileHandler
or DefaultHttpHandler or Page. But MonoRailHttpHandler only implements
IHttpHandler and doesn't inherit any class.
So it seems that Server.Transfer cannot be used for internal server
redirects to monorail actions. Is it right?
Does anybody have successful experience in Server.Transfer to monorail
actions, or know any other way for internal server rewrites to
monorail actions?
Maybe anybody knows any other solution for 404 custom error pages
which would satisfy our requirements?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---