public class UtlJsp extends Object
JSP utilities. TODO replace with services (interfaces).
| Constructor and Description |
|---|
UtlJsp() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addJsonChar(char pCh,
StringBuffer pSb,
boolean pIsStartSpaces)
Adapt char to Json and add into stringbuffer.
|
String |
escapeHtml(String pSource)
Escape HTML character to UTF-8 for given string.
|
String |
evalFileNameWithoutExtension(String pPath)
Clip file name from full path.
|
String |
getGt()
To compare for inside JSP EL.
|
String |
getLt()
To compare for inside JSP EL.
|
org.beigesoft.service.ISrvNumberToString |
getSrvNumberToString()
Getter for srvNumberToString.
|
String |
htmlEscape(char pChar)
Escape HTML character to UTF-8 for given character.
|
boolean |
isJsonAdaptable(char ch)
Check if character need to be JSON adapted.
|
boolean |
isUseless(char ch)
Check if character is useless
cause generated by JSP.
|
String |
nullOrJsonStr(String src)
Return either string null if src is null or src with quotes.
|
String |
printNumber(String pNumber,
String pDigSep,
String pDigGrSep,
Integer pDecPlAfDot,
Integer pDigitsInGroup)
Prints number formatted by given decimal separator, decimal group
separator, decimal places after dot and digits in group.
|
String |
removeApos(String pSource)
Remove apostrophes from string.
|
void |
setSrvNumberToString(org.beigesoft.service.ISrvNumberToString pSrvNumberToString)
Setter for srvNumberToString.
|
String |
toJsonString(String source)
Convert string to JSON string.
|
String |
toJsonStringAndClose(Reader source)
Convert source from Reader to JSON string.
|
public final String printNumber(String pNumber, String pDigSep, String pDigGrSep, Integer pDecPlAfDot, Integer pDigitsInGroup)
Prints number formatted by given decimal separator, decimal group separator, decimal places after dot and digits in group.
pNumber - e.g. "12146678.12"pDigSep - decimal separator, e.g. ","pDigGrSep - decimal group separator, e.g. " "pDecPlAfDot - decimal places after dot, e.g. 2pDigitsInGroup - Digits in group, e.g. 3public final String toJsonStringAndClose(Reader source) throws Exception
Convert source from Reader to JSON string. I.e. replace new lines with '\n' (U+000A) and so on. It also close Reader cause it's assumed to be used it a JSP page. JSP make a lot of userless new lines, spaces, so they will be removed
source - to be convertedException - an exceptionpublic final String toJsonString(String source) throws Exception
Convert string to JSON string. I.e. replace new lines with '\n' (U+000A) and so on. It also close Reader cause it's assumed to be used it a JSP page. JSP make a lot of userless new lines, spaces, so they will be removed
source - to be convertedException - an exceptionpublic final boolean addJsonChar(char pCh,
StringBuffer pSb,
boolean pIsStartSpaces)
Adapt char to Json and add into stringbuffer.
pCh - to be adaptedpSb - StringBufferpIsStartSpaces - if it is start/continue spacespublic final boolean isUseless(char ch)
Check if character is useless cause generated by JSP.
ch - char to checkpublic final boolean isJsonAdaptable(char ch)
Check if character need to be JSON adapted. I.e. if it is new line...
ch - char to checkpublic final String removeApos(String pSource)
Remove apostrophes from string.
pSource - string with apostrophespublic final String getGt()
To compare for inside JSP EL.
public final String getLt()
To compare for inside JSP EL.
public final String nullOrJsonStr(String src)
Return either string null if src is null or src with quotes.
src - stringpublic final String escapeHtml(String pSource)
Escape HTML character to UTF-8 for given string.
pSource - stringpublic final String evalFileNameWithoutExtension(String pPath)
Clip file name from full path.
pPath - stringpublic final String htmlEscape(char pChar)
Escape HTML character to UTF-8 for given character.
pChar - character e.g. '''public final org.beigesoft.service.ISrvNumberToString getSrvNumberToString()
Getter for srvNumberToString.
public final void setSrvNumberToString(org.beigesoft.service.ISrvNumberToString pSrvNumberToString)
Setter for srvNumberToString.
pSrvNumberToString - referenceCopyright © 2016–2018. All rights reserved.