TomRed.net

  • Increase font size
  • Default font size
  • Decrease font size
Subscribe Bookmark and Share
Home Tutorials Other FatWire Find all available variables on a page

FatWire Find all available variables on a page

User Rating: / 0
PoorBest 

When developing it is often useful to identify the variables that are available to you at any given moment and the values associated with them. FatWire offer a simple method in the ics library GetVars() which returns an enumeration of all the variables in all scopes accessible at that instance. I have included this below along with a simple key value pair style html output. This isn't necessary but aids in visually identifying the var you are looking for (if any). This code can be included in any FatWire JSP.

<%
	Enumeration em = ics.GetVars();
	while (em.hasMoreElements()) {
		String key = (String)em.nextElement();
		out.println(" key is " + key + " value " + ics.GetVar(key));					
	}							
%>

The key is the variable name and the value is the value assigned to that variable. This is useful when debugging in FatWire.