Dumping HTTP Servlet Request Attributes and Parameters in CF
Published on April 27, 2020
By Pete Freitag
By Pete Freitag
Here's a little code snippet I wrote many years ago to dump out all the http servlet request attributes or parameters from ColdFusion / Lucee (CFML):
<cfset pageContext = getPageContext()> <cfset httpReq = pageContext.getRequest()> <h3>HttpRequest Parameters</h3> <cfdump var="#httpReq.getParameterMap()#"> <h3>HttpRequest Attributes</h3> <cfset atrib = httpReq.getAttributeNames()> <cfloop condition="#atrib.hasMoreElements()#"> <cfset name = atrib.nextElement()> <strong><cfoutput>#name#</cfoutput></strong> = <cfdump var="#httpReq.getAttribute(name)#"> <hr /> </cfloop>
Dumping HTTP Servlet Request Attributes and Parameters in CF was first published on April 27, 2020.
If you like reading about cfml, servlet, or coldfusion then you might also like:
- Left and Right Accept Negative Counts
- URL Safe Base64 Encoding / Decoding in CFML
- Using Hashicorp Vault with ColdFusion
- CFML Left and Right Functions can Accept Negative Counts
The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.
Try Fixinator
All these can help folks with dealing with issues from the recent ghostcat-related tomcat changes, when people may find that CF requests fail, for need of perhaps modifying the ajp connector's allowedrequestattributespattern attribute.