1.代替<cfinclude> eg:

<cfscript>
getPageContext().include("path/yourfile");
</cfscript>

2.代替<cflocation> eg:

<cfscript>
getPageContext().forward("/path/template");
</cfscript>

3.访问http头 eg:

<cfset req = getPageContext().getRequest() />
<cfset headerlist = req.getHeaderNames() />
<cfoutput>
  <table>
    <cfloop condition="headerlist.hasMoreElements()">
      <cfset header = headerlist.nextElement() />
      <cfset vallist = req.getHeaders(header) />
      <tr>
        <td>#header#:</td>
        <td><cfloop condition="vallist.hasMoreElements()">
            #vallist.nextElement()#<br />
          </cfloop>
        </td>
      </tr>
    </cfloop>
  </table>
</cfoutput>

更多方法请:

<cfdump var="#getPageContext()#" />

相关文章:

  • 2021-11-05
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-15
  • 2021-08-22
  • 2021-08-10
  • 2021-09-15
相关资源
相似解决方案