remember that controller actions are merely c# methods. so - you should be able to call these methods.
now there's the thing called "Rescue" on later versions (and I strongly advise you to move from RC3 to trunk) you can specify a rescue controller. the meaning - you can wire exceptions (like http exceptions and ControllerNotFound exceptions for instance) into a rescue controller, with it's logic and it's views. On Wed, Feb 4, 2009 at 6:00 PM, ghostWhite <[email protected]> wrote: > > 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. > > > > -- Ken Egozi. http://www.kenegozi.com/blog http://www.delver.com http://www.musicglue.com http://www.castleproject.org http://www.gotfriends.co.il --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
