|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.web.fn.ServletFns
public class ServletFns
Providing servlet relevant functions for EL.
Constructor Summary | |
---|---|
protected |
ServletFns()
|
Method Summary | |
---|---|
static java.lang.String |
encodeURL(java.lang.String uri)
Encodes a URL. |
static RequestContext |
getCurrentContext()
Returns the current EL context. |
static java.io.Writer |
getCurrentOut()
Returns the current output. |
static javax.servlet.ServletRequest |
getCurrentRequest()
Returns the current servlet request, or null if not available. |
static javax.servlet.ServletResponse |
getCurrentResponse()
Returns the current servlet response, or null if not available. |
static javax.servlet.ServletContext |
getCurrentServletContext()
Returns the current servlet context, or null if not available. |
static boolean |
isBrowser(java.lang.String type)
Returns whether the current request is from a browser of the specified type. |
static boolean |
isExplorer()
Returns whether the browser of the current request is Explorer. |
static boolean |
isExplorer7()
Returns whether the browser of the current request is Explorer 7 or later. |
static boolean |
isGecko()
Returns whether the browser of the current request is Gecko based, such as Mozilla, Firefox and Camino. |
static boolean |
isGecko3()
Returns whether the browser is Gecko 3 based, such as Firefox 3. |
static boolean |
isOpera()
Returns whether the browser of the current request is Opera. |
static boolean |
isSafari()
Returns whether the browser of the current request is Safari. |
static void |
render(ActionContext ac)
Renders the DSP fragment from EL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ServletFns()
Method Detail |
---|
public static java.lang.String encodeURL(java.lang.String uri) throws javax.servlet.ServletException
If an URI contains "*", it will be replaced with a proper Locale. For example, if the current Locale is zh_TW and the resource is named "ab*.cd", then it searches "ab_zh_TW.cd", "ab_zh.cd" and then "ab.cd", until any of them is found.
Note: "*" must be right before ".", or the last character. For example, "ab*.cd" and "ab*" are both correct, while "ab*cd" and "ab*\/cd" are ignored.
If an URI contains two "*", the first "*" will be replaced with a browser code and the second with a proper locale. The browser code depends on what browser the user are used to visit the web site. Currently, the code for Internet Explorer is "ie", Safari is "saf", Opera is "opr" and all others are "moz". Thus, in the above example, if the resource is named "ab**.cd" and Firefox is used, then it searches "abmoz_zh_TW.cd", "abmoz_zh.cd" and then "abmoz.cd", until any of them is found.
javax.servlet.ServletException
public static boolean isBrowser(java.lang.String type)
type
- the type of the browser.
Allowed values include "robot", "ie", "ie6", "ie6-", "ie7", "ie8",
"ie7-", "gecko", "gecko2", "gecko3", "gecko2-",
"opara", "safari",
"mil", "hil", "mil-".public static boolean isExplorer()
public static boolean isExplorer7()
public static boolean isGecko()
public static boolean isGecko3()
public static boolean isSafari()
public static boolean isOpera()
public static RequestContext getCurrentContext()
public static java.io.Writer getCurrentOut() throws java.io.IOException
java.io.IOException
public static javax.servlet.ServletContext getCurrentServletContext()
public static javax.servlet.ServletRequest getCurrentRequest()
public static javax.servlet.ServletResponse getCurrentResponse()
public static void render(ActionContext ac) throws DspException, java.io.IOException
ac
- the action context; never null.
DspException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |