Decision Center API

ilog.webui.dhtml
Class IlxWUtil

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

public class IlxWUtil
extends Object
implements ilog.webui.dhtml.IlxWConstants

Utility methods.


Method Summary
static String escape(String s)
          Escapes the given text into a JavaScript string.
static boolean hasSessionExpired(javax.servlet.http.HttpSession session)
           
static void prettyPrintBOM(Reader reader, Writer out)
          Formats the BOM code read in the given reader in an HTML block.
static void prettyPrintIrl(Reader reader, Writer out)
          Formats the IRL code read in the given reader in an HTML block.
static void prettyPrintJava(Reader reader, Writer out)
          Formats the Java code read in the given reader in an HTML block.
static void prettyPrintJSP(Reader reader, Writer out)
          Formats the JSP code read in the given reader in an HTML block.
static void sendLoadURL(javax.servlet.http.HttpServletResponse response, String url)
          Prints an HTML page containing a script block that asks the browser to request the specified URL.
static void setClientStatus(String message)
          Asks to modify the status of the browser window with the given message.
static String toHtml(Color color)
          Converts the given AWT color to an hexadecimal string representation of the color.
static String toHtml(String s)
          Converts the given string into an HTML string.
static String toXml(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 String toHtml(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:


toXml

public static String toXml(String s)
Converts the given string into an XML string.


escape

public static String escape(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 String toHtml(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(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,
                               String url)
                        throws 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:
IOException

prettyPrintJSP

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


prettyPrintBOM

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


prettyPrintJava

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


prettyPrintIrl

public static void prettyPrintIrl(Reader reader,
                                  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)

Decision Center API

© Copyright IBM Corp. 1987, 2013