...

Expand
titleSample code for form data submission to a web service.

Refer Posting Data using the POST Method.


Expand
titleHow to load CT framework's template files that have been modified using etag?

Whenever you modify any CTTPL files that comes with CT framework, it is necessary to ensure that the updated template (CTTPL) files are loaded correctly. To load the updated CT framework templates files using etag, add the following code snippet in the CT_Home.jsp page of Canvas Studio:

Note

The following code must be added to the Home page JSP of the application too if the application is not created using the Canvas platform's codegen.


Code Block
languagexml
<%@ page
	import = "com.intellectdesign.canvas.login.sessions.SessionInfo,
	org.json.JSONArray,org.json.JSONObject,org.json.JSONException,
	com.intellectdesign.canvas.login.sessions.SessionManager,
	com.intellectdesign.canvas.deviceband.TargetedFramework,
	com.intellectdesign.canvas.downloadmanager.RuntimeChangeRegistry"
%>

<div 
	data-item-id = "CHANGED_CTTPL" 
	style = "display:none">
	
	<%
		RuntimeChangeRegistry changedCttpFiles = RuntimeChangeRegistry.getInstance();
		out.print(changedCttpFiles.getCttplFilesChanged());
	%>
</div>
	
<!-- The following div tag code will be used to load the default CTTPL file -->
<div 
	data-item-id = "DEFAULT_CTTPL" 
	style = "display:none">
	
	<%
		RuntimeChangeRegistry defaultCttpFile=RuntimeChangeRegistry.getInstance();

		if(defaultCttpFile.getDefaultCttplFileChanged() != null && !defaultCttpFile.getDefaultCttplFileChanged().isEmpty())
			out.print(defaultCttpFile.getDefaultCttplFileChanged().get(0));
		else
			out.print("");
	%>
</div>