Class UtilFunction
java.lang.Object
org.bgerp.app.servlet.jsp.UtilFunction
Functions defined in util.tld JSP library.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringAction call URL likeactionPath.do?method=methodNameout of semicolon separated action class and methodactionId:methodNamestatic Stringchecked='1'if the value istrue.static Stringchecked='1'if the collection contains the object.static StringDocumentation URL for the currently running app versionstatic StringAppends aversionquery param with the file's last modification time, for cache busting.static IntegerConverts a value toInteger.static StringhtmlEncode(String value) Replaces some HTML symbols.static StringhttpLinksToHtml(String value) Recognizes and replaces HTTP links to HTML code.static ObjectnewInstance(String className) Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.static ObjectnewInstance(String className, Object arg0) Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.static ObjectnewInstance(String className, Object... args) Creates a new instance of a Java class.static ObjectnewInstance(String className, Object arg0, Object arg1) Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.static ObjectnewInstance(String className, Object arg0, Object arg1, Object arg2) Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.objectTitleList(List<T> fullList, Set<Integer> selectedIds) Deprecated.static StringquotEscape(String value) Escapes double quotes, used for preparation JS strings in JSPs.static Stringselected='1'if the value istrue.static Stringselected='1'if the collection contains the object.static final StringtoString(Collection<?> valuesList) Deprecated.static StringtruncateHtml(String s, Integer limit) Truncates a string with HTML markup to a maximal length without breaking tags.static Stringuiid()Unique identifier for HTML nodes.static StringURL-encodes a value in UTF-8.
-
Method Details
-
newInstance
Creates a new instance of a Java class. Generic method with varargs argument, can't be called from JSP.- Parameters:
className- the class name.args- constructor arguments.- Returns:
- the created instance
- Throws:
Exception- if no matching constructor is found or instantiation fails
-
newInstance
Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.- Parameters:
className- the class name- Returns:
- the created instance
- Throws:
Exception- if no matching constructor is found or instantiation fails
-
newInstance
Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.- Parameters:
className- the class namearg0- constructor argument- Returns:
- the created instance
- Throws:
Exception- if no matching constructor is found or instantiation fails
-
newInstance
Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.- Parameters:
className- the class namearg0- constructor argumentarg1- constructor argument- Returns:
- the created instance
- Throws:
Exception- if no matching constructor is found or instantiation fails
-
newInstance
public static Object newInstance(String className, Object arg0, Object arg1, Object arg2) throws Exception Non-varargs version ofnewInstance(String, Object...)for using as a JSP taglib method.- Parameters:
className- the class namearg0- constructor argumentarg1- constructor argumentarg2- constructor argument- Returns:
- the created instance
- Throws:
Exception- if no matching constructor is found or instantiation fails
-
checked
-
checked
-
selected
-
selected
-
getInt
-
uiid
Unique identifier for HTML nodes.- Returns:
- an unique identifier for HTML nodes.
-
urlEncode
URL-encodes a value in UTF-8.- Parameters:
value- the value- Returns:
- encoded value
- Throws:
UnsupportedEncodingException- never, UTF-8 is always supported
-
htmlEncode
-
httpLinksToHtml
-
quotEscape
-
truncateHtml
Truncates a string with HTML markup to a maximal length without breaking tags. Finds a first position after all tags were closed, so the resulting length may be more than max.- Parameters:
s- the initial stringlimit- maximal length- Returns:
- the truncated string
-
fileNameWithLastModTime
-
docUrl
-
actionUrl
Action call URL likeactionPath.do?method=methodNameout of semicolon separated action class and methodactionId:methodName- Parameters:
action- the semicolon separated action class and method- Returns:
- the URL
- Throws:
javassist.NotFoundException- if the action class is not found
-
toString
Deprecated.Comma-joined string of the collection values.- Parameters:
valuesList- the values- Returns:
- comma-joined string
-
objectTitleList
@Deprecated public static <T extends IdTitle> String objectTitleList(List<T> fullList, Set<Integer> selectedIds) Deprecated.Comma-joined titles of the selected objects.- Type Parameters:
T- object type- Parameters:
fullList- all objectsselectedIds- selected object IDs- Returns:
- comma-joined titles
-