Trouble with noExecution() and PDF

Hi evryone, cbUsers!
Sorry for the very simple questions.

(I’m using nullSupport=false now :sweat_smile:)

#1
I can’t use noExecution () correctly.
Maybe I didn’t quite understand how to use it.

This is my code:

function postEvent( event, data, buffer, rc, prc ){
 
   event.renderData( data=result, contentType="text/json", type="json" );
   event.noExecution();

   dump( notExistVariable );

}

I expect this code won’t get to:

dump( notExistVariable );

because should it stop earlier, when it meets:

event.noExecution()

but is not so.

Am I doing something wrong?

If I use abort, renderData() doesn’t show anything.

#2
I can’t understand if, to send the data to the views, it is preferable to use the “rc” or “prc” structure.
Or event.set/getValue().

#3
Last.
I’m training to generate a PDF

I’ve got this code:

Controller: Main.cfc

component {

    //?event=main.list
    function list( event, rc, prc ){
        event.setValue("result", "Hello Coldbox!");
        event.setView( "main/list" );
    }

    //?event=main.print
    function print( event, rc, prc ) {
        event.setValue("result", "Hello Coldbox!");
        event.renderData( data=renderView("main/list"), type="PDF" );
    }
}

View:

<cfoutput>#event.getValue("result")#</cfoutput>

list() method generates view to browser correctly, but i’ve got error where i use print() method.

I’ve get this error on browser

image

and this from logs:
(“Hello Coldbox!” is output in my view)

[ERROR] runwar.context: 2022-06-19 01:36:23 coldbox.system.Bootstrap Error: invalid variable declaration [Hello Coldbox!]

{
   "ExtraInfo":{
      "Extended_Info":"",
      "Message":"invalid variable declaration [Hello Coldbox!\r\n]",
      "Detail":"",
      "additional":{
         
      },
      "TagContext":[
         {
            "Raw_Trace":"coldbox.system.core.conversion.datamarshaller_cfc$cf.udfCall(/coldbox/system/core/conversion/DataMarshaller.cfc:147)",
            "codePrintPlain":"145: cfcontent(\n146: type     = \"#arguments.type#\",\n147: variable = \"#arguments.variable#\",\n148: reset    = \"#arguments.reset#\"\n149: );\n",
            "column":0,
            "line":147,
            "template":"S:\\workspace\\users\\roberto\\vhosts\\test-lucee\\test-coldbox\\coldbox\\system\\core\\conversion\\DataMarshaller.cfc",
            "id":"??",
            "type":"cfml",
            "codePrintHTML":"145: cfcontent(<br>\n146: type     = &quot;#arguments.type#&quot;,<br>\n<b>147: variable = &quot;#arguments.variable#&quot;,</b><br>\n148: reset    = &quot;#arguments.reset#&quot;<br>\n149: );<br>\n"
         },
         {
            "Raw_Trace":"coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:387)",
            "codePrintPlain":"385: cbController\n386: .getDataMarshaller()\n387: .renderContent( type = \"#renderData.contentType#\", variable = \"#renderedContent#\" );\n388: }\n389: // Non Binary\n",
            "column":0,
            "line":387,
            "template":"S:\\workspace\\users\\roberto\\vhosts\\test-lucee\\test-coldbox\\coldbox\\system\\Bootstrap.cfc",
            "id":"??",
            "type":"cfml",
            "codePrintHTML":"385: cbController<br>\n386: .getDataMarshaller()<br>\n<b>387: .renderContent( type = &quot;#renderData.contentType#&quot;, variable = &quot;#renderedContent#&quot; );</b><br>\n388: }<br>\n389: // Non Binary<br>\n"
         },
         {
            "Raw_Trace":"coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:507)",
            "codePrintPlain":"505: // Process A ColdBox Request Only\n506: if ( findNoCase( \"index.cfm\", listLast( arguments.targetPage, \"/\" ) ) ) {\n507: processColdBoxRequest();\n508: }\n509: return true;\n",
            "column":0,
            "line":507,
            "template":"S:\\workspace\\users\\roberto\\vhosts\\test-lucee\\test-coldbox\\coldbox\\system\\Bootstrap.cfc",
            "id":"??",
            "type":"cfml",
            "codePrintHTML":"505: // Process A ColdBox Request Only<br>\n506: if ( findNoCase( &quot;index.cfm&quot;, listLast( arguments.targetPage, &quot;/&quot; ) ) ) {<br>\n<b>507: processColdBoxRequest();</b><br>\n508: }<br>\n509: return true;<br>\n"
         },
         {
            "Raw_Trace":"app1.application_cfc$cf$v.udfCall(/app1/Application.cfc:32)",
            "codePrintPlain":"30: onApplicationStart()\n31: \n32: application.cbBootstrap.onRequestStart( arguments.targetPage );\n33: \n34: return true;\n",
            "column":0,
            "line":32,
            "template":"S:\\workspace\\users\\roberto\\vhosts\\test-lucee\\test-coldbox\\app1\\Application.cfc",
            "id":"??",
            "type":"cfml",
            "codePrintHTML":"30: onApplicationStart()<br>\n31: <br>\n<b>32: application.cbBootstrap.onRequestStart( arguments.targetPage );</b><br>\n33: <br>\n34: return true;<br>\n"
         }
      ],
      "ErrorCode":"0",
      "ErrNumber":0,
      "type":"expression",
      "StackTrace":"lucee.runtime.interpreter.InterpreterException: invalid variable declaration [Hello Coldbox!\r\n] lucee.runtime.interpreter.VariableInterpreter.getVariable(VariableInterpreter.java:120) lucee.runtime.PageContextImpl.getVariable(PageContextImpl.java:1585) lucee.runtime.tag.Content.setVariable(Content.java:128) coldbox.system.core.conversion.datamarshaller_cfc$cf.udfCall(/coldbox/system/core/conversion/DataMarshaller.cfc:147) lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) lucee.runtime.type.UDFImpl._call(UDFImpl.java:350r\n\tat lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:213) lucee.runtime.ComponentImpl._call(ComponentImpl.java:698) lucee.runtime.ComponentImpl._call(ComponentImpl.java:585) lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1951) lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:866) lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1781) coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:387) coldbox.system.bootstrap_cfc$cf.udfCall(/coldbox/system/Bootstrap.cfc) lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:786) lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1762) coldbox.system.bootstrap_cfc$cf.udfCall1(/coldbox/system/Bootstrap.cfc:507) coldbox.system.bootstrap_cfc$cf.udfCall(/coldbox/system/Bootstrap.cfc) lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) lucee.runtime.ComponentImpl._call(ComponentImpl.java:697) lucee.runtime.ComponentImpl._call(ComponentImpl.java:585) lucee.runtime.ComponentImpl.call(ComponentImpl.java:1932) lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787) lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1762) app1.application_cfc$cf$v.udfCall(/app1/Application.cfc:32) lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) lucee.runtime.type.UDFImpl._call(UDFImpl.java:350) lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) lucee.runtime.ComponentImpl._call(ComponentImpl.java:697) lucee.runtime.ComponentImpl._call(ComponentImpl.java:585) lucee.runtime.ComponentImpl.call(ComponentImpl.java:1932) lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:444) lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:135) lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2475) lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2465) lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2436) lucee.runtime.engine.Request.exe(Request.java:45) lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1206) lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1152) lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) javax.servlet.http.HttpServlet.service(HttpServlet.java:590) io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) org.cfmlprojects.regexpathinfofilter.RegexPathInfoFilter.doFilter(RegexPathInfoFilter.java:47) io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)\r\\[ERROR] runwar.context: n\tat io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275) io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79) io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134) io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131) io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44) io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255) io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79) io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100) io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852) org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449) org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280) java.base/java.lang.Thread.run(Unknown Source)\r\n",
      "ExtendedInfo":""
   }
}

Any idea?

As usual, many many thanks :heart: