Difference between revisions of "JSP Attachment Deprecation"

From AgileApps Support Wiki
imported>Aeric
(Created page with "{{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. '''Backg...")
 
imported>Aeric
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{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.
{{Deprecated|<br>A document template based on a JSP page can no longer be included as attachment in an [[Email Template]], due to limitations on the number of contexts in which it can be successfully used.


'''Background:'''  
(Existing templates are not affected. But when adding new attachments, JSP templates no longer appear in the list.)
:JSP pages need to be compiled and generated in a scheduled background process. But the background processes 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.  
 
'''Explanation:'''  
:An attachment that is generated from JSP a template works when a message is sent interactively. However, it is not possible to send such an attachment from a Rule, a Process, or one of the Java sendEmail APIs.  


'''Suggested Alternative:''' Use an [[HTML Document Template]].
'''Suggested Alternative:''' Use an [[HTML Document Template]].
:* ''Wherever possible:'' In place of Java code, use Velocity code for loops and conditionals.  
:* 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.
:* If necessary, use Java code to create a [[Document Template Class]], and use that class to provide the data that the template processes.


{{Best|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.)}}
{{Best|Identify email templates that include a JSP-based attachment, so designers and developers know to avoid them in Rules, Processes and Java code. For example, add the word "Interactive" or "JSP" to the template name. (That practice also helps to identify document templates that need to be converted.)}}
}}
}}

Latest revision as of 00:49, 21 March 2014

Warn.png

DEPRECATED:
A document template based on a JSP page can no longer be included as attachment in an Email Template, due to limitations on the number of contexts in which it can be successfully used.

(Existing templates are not affected. But when adding new attachments, JSP templates no longer appear in the list.)

Explanation:

An attachment that is generated from JSP a template works when a message is sent interactively. However, it is not possible to send such an attachment from a Rule, a Process, or one of the Java sendEmail APIs.

Suggested Alternative: Use an HTML Document Template.

  • Use Velocity code for loops and conditionals, in place of Java code.
  • If 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 email templates that include a JSP-based attachment, so designers and developers know to avoid them in Rules, Processes and Java code. For example, add the word "Interactive" or "JSP" to the template name. (That practice also helps to identify document templates that need to be converted.)