|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.simpleservlets.htmlobjects.HTMLUtil
public class HTMLUtil
Miscellaneous utilities and tools for use with HTMLObjects.
| Method Summary | |
|---|---|
static void |
addWarning(String msg,
HTMLElement con)
Adds a highlighted warning message to the passed container. |
static String |
processMarkupEntities(String src)
Processes the string passed in substituting the any of the special markup language characters with their markup entities. |
static int |
send(HTMLPage page,
HttpServletResponse res)
Sends the content on the specified page as text/html. |
static int |
send(HTMLPage page,
PageContext pc)
Sends the content on the specified page as text/html. |
static String |
toStringParsed(Object value)
Returns a string representation of the passed value which has been processed for entities. |
static String |
toStringUnparsed(Object value)
Returns a string representation of the passed value which has NOT been processed for entities. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int send(HTMLPage page,
HttpServletResponse res)
throws IOException
page - the page tree to traverse to produce the contentres - the place to send the content
IOException - if there is a problem writing the content.
public static int send(HTMLPage page,
PageContext pc)
throws PageProcessorException
page - the page tree to traverse to produce the contentpc - the place to send the content (uses pc.response).
PageProcessorException - if there is a problem writing the content.
public static void addWarning(String msg,
HTMLElement con)
msg - warning message to displaycon - container to add the formatted message topublic static String processMarkupEntities(String src)
< < > > & & " " ' 'Note that ' is an entity in XML but not an entity in HTML.
If src does not contain any of these special characters, then src itself is returned unmodified (a new String is not constructed). If src is null, then null is returned. Otherwise, a new String is returned with the substitutions made.
Note that passing the returned String back into this method will produce yet another new String with the ampersands substituted. For example:
| Before | After |
| Small < Medium | Small < Medium |
| Small < Medium | Small &lt; Medium |
public static String toStringParsed(Object value)
public static String toStringUnparsed(Object value)
|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||