ilog.webui.dhtml

Class IlxWUtil

  • java.lang.Object
    • ilog.webui.dhtml.IlxWUtil
  • All Implemented Interfaces:
    ilog.webui.dhtml.IlxWConstants


    public class IlxWUtil
    extends java.lang.Object
    implements ilog.webui.dhtml.IlxWConstants
    Utility methods.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String escape(java.lang.String s)
      Escapes the given text into a JavaScript string.
      static boolean hasSessionExpired(javax.servlet.http.HttpSession session) 
      static void prettyPrintBOM(java.io.Reader reader, java.io.Writer out)
      Formats the BOM code read in the given reader in an HTML block.
      static void prettyPrintIrl(java.io.Reader reader, java.io.Writer out)
      Formats the IRL code read in the given reader in an HTML block.
      static void prettyPrintJava(java.io.Reader reader, java.io.Writer out)
      Formats the Java code read in the given reader in an HTML block.
      static void prettyPrintJSP(java.io.Reader reader, java.io.Writer out)
      Formats the JSP code read in the given reader in an HTML block.
      static void sendLoadURL(javax.servlet.http.HttpServletResponse response, java.lang.String url)
      Prints an HTML page containing a script block that asks the browser to request the specified URL.
      static void setClientStatus(java.lang.String message)
      Asks to modify the status of the browser window with the given message.
      static java.lang.String toHtml(java.awt.Color color)
      Converts the given AWT color to an hexadecimal string representation of the color.
      static java.lang.String toHtml(java.lang.String s)
      Converts the given string into an HTML string.
      static java.lang.String toXml(java.lang.String s)
      Converts the given string into an XML string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toHtml

        public static java.lang.String toHtml(java.lang.String s)
        Converts the given string into an HTML string.

        This method is similar to toXml(java.lang.String) except that it generates some special HTML text for special characters:

        • '\n' is converted into '<br>'
        • '\t' is converted into '&nbsp;&nbsp;&nbsp;&nbsp;'
        • ' ' is converted into '&nbsp;'
      • toXml

        public static java.lang.String toXml(java.lang.String s)
        Converts the given string into an XML string.
      • escape

        public static java.lang.String escape(java.lang.String s)
        Escapes the given text into a JavaScript string.

        The surrounding quotes are not included; they must be placed by the caller.

      • toHtml

        public static java.lang.String toHtml(java.awt.Color color)
        Converts the given AWT color to an hexadecimal string representation of the color.

        For instance Color.white is converted into "#FFFFF".

        Parameters:
        color - An AWT color. May be null.
        Returns:
        A string, or null if the given color is null.
      • setClientStatus

        public static void setClientStatus(java.lang.String message)
        Asks to modify the status of the browser window with the given message.

        This will be done using the current port and adding a JavaScript command to it, which will be executed when the response associated with the port will be sent to the client.

        Parameters:
        message - The message to display.
        See Also:
        IlxWPort.getCurrentPort()
      • sendLoadURL

        public static void sendLoadURL(javax.servlet.http.HttpServletResponse response,
                       java.lang.String url)
                                throws java.io.IOException
        Prints an HTML page containing a script block that asks the browser to request the specified URL.

        This method performs almost the same job as HttpServletResponse.sendRedirect, but is safer, since sendRedirect has a bad behavior on IE5.0 and IE5.5. Actually, when redirecting the response to a given URL, the caching headers are not taken into account by the browser and the page is directly reloaded from the IE cache. This has been fixed in IE6.0. For optimal portability, use sendLoadURL instead of sendRedirect.

        Throws:
        java.io.IOException
      • prettyPrintJSP

        public static void prettyPrintJSP(java.io.Reader reader,
                          java.io.Writer out)
        Formats the JSP code read in the given reader in an HTML block.
      • prettyPrintBOM

        public static void prettyPrintBOM(java.io.Reader reader,
                          java.io.Writer out)
        Formats the BOM code read in the given reader in an HTML block.
      • prettyPrintJava

        public static void prettyPrintJava(java.io.Reader reader,
                           java.io.Writer out)
        Formats the Java code read in the given reader in an HTML block.
      • prettyPrintIrl

        public static void prettyPrintIrl(java.io.Reader reader,
                          java.io.Writer out)
        Formats the IRL code read in the given reader in an HTML block.
      • hasSessionExpired

        public static boolean hasSessionExpired(javax.servlet.http.HttpSession session)

© Copyright IBM Corp. 1987, 2017