RE: [coldbox:10827] event.getvalue issue in 3.1?

I would guess that the framework is getting the view of the current request using your new getValue() method and you have changed the behavior of that method in such a way that it no longer works.

Check out the original getValue() method and ensure you are covering all the original functionality. Specifically the private request collection!

~Brad

Ok so copy the getvalue function into my requestcontext component and then start from there. I was copying the example and trying to recreate the wheel.

Yes. You should be able to only swap the array-notation parts back out with evaluate() and swap the structKeyExists() parts with isDefined().

So, specifically,

if( structKeyExists(collection, arguments.name) ){
return collection[arguments.name];
}

would be come this again:

if ( isDefined(“instance.context.#arguments.name#”) ){
return Evaluate(“instance.context.#arguments.name#”);
}

etc, etc.

Thanks!

~Brad

I did that and I get the crazy setview issue again.

I also did a really simple change and had if default section return a 1 and I get a redirect loop.

Application Execution ExceptionError Type: Renderer.ViewNotSetException : [N/A]

Error Messages: The “currentview” variable has not been set, therefore there is no view to render.
Please remember to use the ‘event.setView()’ method in your handler or pass in a view to render.

the code

var collection = instance.context;

// private context switch
if( arguments.private ){ collection = instance.privateContext; }

// Check if key exists

if ( isDefined(“instance.context.#arguments.name#”) ){
return Evaluate(“instance.context.#arguments.name#”);
}

// Default value
if( structKeyExists(arguments, “defaultValue”) ){
return arguments.defaultValue;
}

$throw(“The variable: #arguments.name# is undefined in the request collection (private=#arguments.private#)”,
“Keys Found: #structKeyList(collection)#”,
“RequestContext.ValueNotFound”);

`

What does the stacktrace say?

coldfusion.runtime.CustomException: The "currentview" variable has not been set, therefore there is no view to render.
	at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142)
	at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
	at cfFrameworkSupertype2ecfc568178064$func$THROW.runFunction(C:\inetpub\wwwroot\evenGame\domain\coldbox\system\FrameworkSupertype.cfc:413)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
	at cfRenderer2ecfc361348183$funcRENDERVIEW.runFunction(C:\inetpub\wwwroot\evenGame\domain\coldbox\system\plugins\Renderer.cfc:115)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
	at cfRenderer2ecfc361348183$funcRENDERLAYOUT.runFunction(C:\inetpub\wwwroot\evenGame\domain\coldbox\system\plugins\Renderer.cfc:371)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
	at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
	at cfColdbox2ecfc1164227082$funcPROCESSCOLDBOXREQUEST.runFunction(C:\inetpub\wwwroot\evenGame\domain\coldbox\system\Coldbox.cfc:261)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
	at cfApplication2ecfc535260561$funcONREQUESTSTART.runFunction(C:\inetpub\wwwroot\evenGame\domain\Application.cfc:52)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
	at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
	at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
	at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
	at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
	at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
	at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
	at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88)
	at coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:258)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:349)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
	at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
	at coldfusion.CfmServlet.service(CfmServlet.java:200)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
	at jrun.servlet.FilterChain.service(FilterChain.java:101)
	at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
	at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
	at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
	at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
	at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
	at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
	at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
	at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

Can you share the requestContect.cfc and also where are you placing this file?

Also why are you hell bent on going back to the older style, if you are rewriting the app anyway.

I am guessing that RequestConext.cfc is not in the right place, so you might need to explain where you placed this file and what is actually in it.

The myrequestcontext.cfc was in the previous message please scrolldown. It is located in the model folder. My coldbox.cfc points to it.

requestContextDecorator = “model.myRequestContext”,

The problem is I have a struct in the RC that is a struct. I am trying to use getvalue because it has the ability to specify a default value if the struct value isn’t there.