JSP Attachment Deprecation

From AgileApps Support Wiki
Revision as of 23:04, 20 March 2014 by imported>Aeric

Warn.png

DEPRECATED: A JSP page can no longer be used as the basis for a document template, due to limitations on the number of contexts in which they can be successfully used.

Background:

JSP pages need to be compiled and generated in a background process. But that background process have no concept of a session, while a session identifier is required when sending an email to ensure that the message goes out with the intended attachments. So it is not possible to send an email attachment when the document template is based on a JSP page, whether in a Rule, a Process, or one of the Java sendEmail APIs. (Such templates worked interactively,

Suggested Alternative: Use an HTML Document Template.

  • Ideally: Use Velocity code for loops and conditionals, in place of Java code.
  • When necessary: Use Java code to create a Document Template Class, and use that class to provide the data that the template processes.

Thumbsup.gif

Best Practice:
Identify existing document templates that are based on JSP pages, so designers know to avoid them in the contexts listed above. For example, add the word "JSP" to the template name. (That practice also helps to identify document templates that need to be converted.)