Package com.orchestranetworks.ui
Interface UIBodyWriter
- All Known Subinterfaces:
UIAjaxContext
,UIComponentWriter
,UIFormPaneWriter
,UIFormWriter
,UILabelRendererContext
,UILabelRendererForHierarchyContext
,UIResponseContext
,UIServiceComponentWriter
,UITableFilterResponseContext
,UserServicePaneWriter
,UserServiceRawPaneWriter
,UserServiceWriter
,WidgetWriter
,WidgetWriterForList
public interface UIBodyWriter
This interface provides methods for adding text to the body of a document.
According to the type of the document (that is, HTML page, Ajax response, etc.),
the text can be HTML code, simple text, a JSON structure or
CSV values.
Important: To prevent XSS issues, the methods addSafeAttribute(String, String)
and addSafeInnerHTML(String)
must be used.
The use of the script tag (<script>
) is strongly discouraged.
It is recommended to use the UIJavaScriptWriter
instead.
- Since:
- 5.2.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd
(int integer) Adds an integer to the body stream.add
(UserMessage aUserMessage) Adds a user message in the current session's locale to the body stream.Adds the specified string to the body stream.add_cr()
Adds a carriage return to the body stream.Adds the specified string to the body stream, then adds a carriage return to the body stream.addSafeAttribute
(String aName, UserMessage aValue) Adds an HTML attribute to the body stream, following the pattern:addSafeAttribute
(String aName, String aValue) Adds an HTML attribute to the body stream, following the pattern:addSafeInnerHTML
(UserMessage aUserMessage) addSafeInnerHTML
(String text) Escapes all '<' and '>' characters in the given string, then adds the string to the body stream.
-
Method Details
-
add
Adds the specified string to the body stream.- Parameters:
aString
- body content (HTML or simple text, depending on the document type).
-
addSafeInnerHTML
Escapes all '<' and '>' characters in the given string, then adds the string to the body stream. This method must be used in order to avoid cross-site scripting (XSS) issues.- Parameters:
text
- body content (HTML or simple text, depending on the document type).- Since:
- 5.4.0
-
addSafeInnerHTML
- See Also:
-
addSafeAttribute
Adds an HTML attribute to the body stream, following the pattern:aName="aValue"
If the given attribute value contains double quotes, the quotes will be escaped.
This method must be used to avoid cross-site scripting (XSS) issues.- Parameters:
aName
- the name of the attributeaValue
- the value of the attribute- Since:
- 5.4.0
-
addSafeAttribute
Adds an HTML attribute to the body stream, following the pattern:aName="aValue"
If the given attribute value contains double quotes, the quotes will be escaped.
This method must be used to avoid cross-site scripting (XSS) issues.- Parameters:
aName
- the name of the attributeaValue
- the value of the attribute- Since:
- 5.4.0
-
add
Adds an integer to the body stream.- Parameters:
integer
- an integer to add to the body.
-
add
Adds a user message in the current session's locale to the body stream.- Parameters:
aUserMessage
- a user message.
-
add_cr
UIBodyWriter add_cr()Adds a carriage return to the body stream. To keep the body source easier to read by a human, does not add the HTML tag <br/>. -
add_cr
Adds the specified string to the body stream, then adds a carriage return to the body stream. To keep the body source easier to read by a human, does not add the HTML tag <br/>.- Parameters:
text
- body content (HTML or simple text according the document type).
-