never seen this.
though off the stack trace is appear to be an ASP.NET problem

maybe you were calling Response.Redirect, which caused the HttpContext to
loose data, then in the view you accessed the RawUrl directly.

a possible fix will be -  get the current url into the propertybag within
the controller

PropertyBag["returnUrl"] = Request.RawUrl; ...

, then the view will simply render that value ($returnUrl)

it also is a good thing, as it leaves HTTP related logic out of the view
(which should deal with string manipulations etc.)




On Thu, Jan 15, 2009 at 6:15 AM, Harry Dhillon <ha...@ripple6.com> wrote:

>  This error was reported by a user of our application.   I was wondering
> if anyone else ever saw something similar or had any suggestions in how to
> determine the root cause ?
>
>
>
>
>
> Server Error in '/' Application.
>
> Cannot get the query string.
>
> Description: An unhandled exception occurred during the execution of the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
>
>
> LINE IN THE NVELOCITY VIEW:  #set($returnUrl = $Request.RawUrl)
>
>
>
> EXCEPTION:
>
> Exception Details: System.Web.HttpException: Cannot get the query string.
>
>
>
> Source Error:
>
>
>
> An unhandled exception was generated during the execution of the current
> web request. Information regarding the origin and location of the exception
> can be identified using the exception stack trace below.
>
>
>
> Stack Trace:
>
>
>
> [HttpException (0x80004005): Cannot get the query string.]
>
>    System.Web.Hosting.ISAPIWorkerRequest.GetQueryString() +2497644
>
>    System.Web.Hosting.ISAPIWorkerRequest.GetRawUrl() +9
>
>    System.Web.HttpRequest.get_RawUrl() +17
>
>    Castle.MonoRail.Framework.Adapters.RequestAdapter.get_RawUrl() +11
>
>
>
> [MethodInvocationException: Invocation of method 'RawUrl' in
> Castle.MonoRail.Framework.Adapters.RequestAdapter, template
> components/RightRailComponent\default.vm Line 15 Column 38 threw an
> exception]
>
>    NVelocity.Runtime.Parser.Node.ASTIdentifier.Execute(Object o,
> IInternalContextAdapter context) +1274
>
>    NVelocity.Runtime.Parser.Node.ASTReference.Execute(Object o,
> IInternalContextAdapter context) +584
>
>    NVelocity.Runtime.Parser.Node.ASTReference.Value(IInternalContextAdapter
> context) +19
>
>
> NVelocity.Runtime.Parser.Node.ASTSetDirective.Render(IInternalContextAdapter
> context, TextWriter writer) +18
>
>    NVelocity.Runtime.Parser.Node.SimpleNode.Render(IInternalContextAdapter
> context, TextWriter writer) +55
>
>
> Castle.MonoRail.Framework.Views.NVelocity.CustomDirectives.AbstractComponentDirective.RenderView(IInternalContextAdapter
> context, String viewToRender, Template template, TextWriter writer) +106
>
>
> Castle.MonoRail.Framework.Views.NVelocity.CustomDirectives.AbstractComponentDirective.RenderComponentView(IInternalContextAdapter
> context, String viewToRender, TextWriter writer, NVelocityViewContextAdapter
> contextAdapter) +262
>
>
> Castle.MonoRail.Framework.Views.NVelocity.CustomDirectives.AbstractComponentDirective.Render(IInternalContextAdapter
> context, TextWriter writer, INode node) +594
>
>
> NVelocity.Runtime.Parser.Node.ASTDirective.Render(IInternalContextAdapter
> context, TextWriter writer) +21
>
>    NVelocity.Runtime.Parser.Node.SimpleNode.Render(IInternalContextAdapter
> context, TextWriter writer) +55
>
>    NVelocity.Template.Merge(IContext context, TextWriter writer) +135
>
>
> Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine.RenderLayout(String
> layoutName, String contents, IContext ctx, IRailsEngineContext context,
> TextWriter output) +94
>
>
>
> [RailsException: Error processing layout. Maybe the layout file does not
> exists? File: layouts\portal\mx\default.vm]
>
>
> Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine.RenderLayout(String
> layoutName, String contents, IContext ctx, IRailsEngineContext context,
> TextWriter output) +212
>
>
> Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine.ProcessLayout(String
> contents, Controller controller, IContext ctx, IRailsEngineContext context)
> +87
>
>
> Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine.Process(IRailsEngineContext
> context, Controller controller, String viewName) +311
>
>
> Castle.MonoRail.Framework.Services.DefaultViewEngineManager.Process(IRailsEngineContext
> context, Controller controller, String templateName) +178
>
>    Castle.MonoRail.Framework.ControllerLifecycleExecutor.ProcessView() +32
>
>
> Castle.MonoRail.Framework.ControllerLifecycleExecutor.ProcessSelectedAction(IDictionary
> actionArgs) +625
>
>
> Castle.MonoRail.Framework.MonoRailHttpHandler.Process(IRailsEngineContext
> context) +359
>
>    Castle.MonoRail.Framework.MonoRailHttpHandler.ProcessRequest(HttpContext
> context) +18
>
>
> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
> +358
>
>    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
>
>
>
>
>
> Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
> ASP.NET Version:2.0.50727.1433
>
> >
>


-- 
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 castle-project-users@googlegroups.com
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to