| java.lang.Object org.sakaiproject.util.Web
Web | public class Web (Code) | |
Web is a web (html, http, etc) technlogies collection of helper methods.
|
Method Summary | |
protected static void | displayStringChars(PrintWriter out, String str) | public static String | escapeHtml(String value) Escape a plaintext string so that it can be output as part of an HTML document. | public static String | escapeHtmlFormattedText(String value) Escape HTML-formatted text in preparation to include it in an HTML document.
Parameters: value - The string to escape. | public static String | escapeJavascript(String value) Return a string based on value that is safe to place into a javascript / html identifier: anything not alphanumeric change to 'x'. | public static String | escapeJsQuoted(String value) Return a string based on value that is safe to place into a javascript value that is in single quiotes.
Parameters: value - The string to escape. | public static String | escapeUrl(String id) Return a string based on id that is fully escaped using URL rules, using a UTF-8 underlying encoding.
Parameters: id - The string to escape. | final protected static char | hexDigit(int i) Returns the hex digit cooresponding to a number between 0 and 15.
Parameters: i - The number to get the hex digit for. | public static String | makePath(String[] parts, int start, int end) Form a path string from the parts of the array starting at index start to the end, each with a '/' in front. | protected static void | print(PrintWriter out, String name, int value) | protected static void | print(PrintWriter out, String name, String value) | public static String | returnUrl(HttpServletRequest req, String path) Compute the URL that would return to this servlet based on the current request, with the optional path and parameters
Parameters: req - The request. | public static void | sendAutoUpdate(PrintWriter out, HttpServletRequest req, String placementId, int updateTime) | public static String | serverUrl(HttpServletRequest req) Compute the URL that would return to this server based on the current request. | public static String | snoop(PrintWriter out, boolean html, ServletConfig config, HttpServletRequest req) | final protected static String | toHex(byte b) Returns a hex representation of a byte.
Parameters: b - The byte to convert to hex. |
ESCAPE_URL | final protected static String ESCAPE_URL(Code) | | These characters are escaped when making a URL
|
ESCAPE_URL_SPECIAL | final protected static String ESCAPE_URL_SPECIAL(Code) | | These can't be encoded in URLs safely even using %nn notation, so encode them using our own custom URL encoding, which the ParameterParser decodes
|
escapeHtml | public static String escapeHtml(String value)(Code) | | Escape a plaintext string so that it can be output as part of an HTML document. Amperstand, greater-than, less-than, newlines, etc, will be escaped so that they display (instead of being interpreted as formatting).
Parameters: value - The string to escape. value fully escaped for HTML. |
escapeHtmlFormattedText | public static String escapeHtmlFormattedText(String value)(Code) | | Escape HTML-formatted text in preparation to include it in an HTML document.
Parameters: value - The string to escape. value escaped for HTML. |
escapeJavascript | public static String escapeJavascript(String value)(Code) | | Return a string based on value that is safe to place into a javascript / html identifier: anything not alphanumeric change to 'x'. If the first character is not alphabetic, a letter 'i' is prepended.
Parameters: value - The string to escape. value fully escaped using javascript / html identifier rules. |
escapeJsQuoted | public static String escapeJsQuoted(String value)(Code) | | Return a string based on value that is safe to place into a javascript value that is in single quiotes.
Parameters: value - The string to escape. value escaped. |
escapeUrl | public static String escapeUrl(String id)(Code) | | Return a string based on id that is fully escaped using URL rules, using a UTF-8 underlying encoding.
Parameters: id - The string to escape. id fully escaped using URL rules. |
hexDigit | final protected static char hexDigit(int i)(Code) | | Returns the hex digit cooresponding to a number between 0 and 15.
Parameters: i - The number to get the hex digit for. The hex digit cooresponding to that number. exception: java.lang.IllegalArgumentException - If supplied digit is not between 0 and 15 inclusive. |
makePath | public static String makePath(String[] parts, int start, int end)(Code) | | Form a path string from the parts of the array starting at index start to the end, each with a '/' in front.
Parameters: parts - The parts strings Parameters: start - The index of the first part to use Parameters: end - The index past the last part to use a path string from the parts of the array starting at index start to the end, each with a '/' in front. |
returnUrl | public static String returnUrl(HttpServletRequest req, String path)(Code) | | Compute the URL that would return to this servlet based on the current request, with the optional path and parameters
Parameters: req - The request. The URL back to this servlet based on the current request. |
sendAutoUpdate | public static void sendAutoUpdate(PrintWriter out, HttpServletRequest req, String placementId, int updateTime)(Code) | | Send the HTML / Javascript to invoke an automatic update
Parameters: out - Parameters: req - The request. Parameters: placementId - The tool's placement id / presence location / part of the delivery address Parameters: updateTime - The time (seconds) between courier checks |
serverUrl | public static String serverUrl(HttpServletRequest req)(Code) | | Compute the URL that would return to this server based on the current request. Note: this method is duplicated in the kernel/request RequestFilter.java
Parameters: req - The request. The URL back to this server based on the current request. |
toHex | final protected static String toHex(byte b)(Code) | | Returns a hex representation of a byte.
Parameters: b - The byte to convert to hex. The 2-digit hex value of the supplied byte. |
|
|