com.ngMAT.servlet
クラス EZServletContext

java.lang.Object
  |
  +--com.ngMAT.Common.ngmObject
        |
        +--com.ngMAT.servlet.EZServletContext
すべての実装インタフェース:
java.lang.Cloneable, ngmObjectFunction, java.io.Serializable

public class EZServletContext
extends ngmObject

ブラウザからの呼出し毎に処理するための情報を一括して管理するためのクラス。EZServletの doIt (HttpServletRequest, HttpServletResponse)の中で、呼出し毎にこのオブジェクトが生成され、 アプリケーション主処理に受け渡される。 doIt (HttpServletRequest, HttpServletResponse) of EZServlet creates an instance of this class for each request and passes it to your application process method. This class provides simple accesses to most information required to process requests from browsers.

関連項目:
直列化された形式

フィールドの概要
protected  EZServletConfig config
           
protected  java.util.Hashtable cookies
           
protected  int cookies_count
           
protected  java.util.Hashtable new_cookies
           
protected  java.util.Vector new_cookies_vector
           
protected  java.lang.Object output
          Output object.This must be an instance of java.lang.String or com.ngMAT.HTML.HTMLTetmplate.
protected  javax.servlet.http.HttpServletRequest req
           
protected  javax.servlet.http.HttpServletResponse res
           
 
インタフェース com.ngMAT.Common.ngmObjectFunction から継承したフィールド
C_BACKSLASH, C_BLOCK_CLOSE, C_BLOCK_OPEN, C_COMMA, C_CR, C_DOUBLE_QUATATION, C_EQUAL, C_LF, C_SINGLE_QUATATION, C_SPACE, C_TAB, S_BACKSLASH, S_BLOCK_CLOSE, S_BLOCK_OPEN, S_COMMA, S_CR, S_CRLF, S_DOUBLE_QUATATION, S_EQUAL, S_LF, S_SINGLE_QUATATION, S_SPACE, S_TAB
 
コンストラクタの概要
EZServletContext()
           
 
メソッドの概要
 void addCookie(java.lang.String name, java.lang.String value)
          Adds a cookie to send.
 void addCookie(java.lang.String name, java.lang.String value, int max_age)
          Adds a cookie to send.
 void addCookie(java.lang.String name, java.lang.String value, java.lang.String path)
          Adds a cookie to send.
 void addCookie(java.lang.String name, java.lang.String value, java.lang.String path, int max_age)
          Adds a cookie to send.
static EZServletContext createContext(EZServletConfig config, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 java.lang.String createCookieString(javax.servlet.http.Cookie cookie)
          Cookieを文字コード変換を伴い、文字列表現に変換する。
static void debug(java.lang.String s)
           
 boolean getBooleanParameter(java.lang.String name)
          Returns specified parameter value as boolean value.
 boolean getBooleanParameter(java.lang.String name, boolean default_value)
          Returns specified parameter value as boolean value.
 EZServletConfig getConfig()
           
 javax.servlet.http.Cookie[] getCookies()
          Returns decoded cookies.
 java.lang.String getCookieValue(java.lang.String name)
          Returns value of specified cookie.
 HTMLComponent getErrorHTML(java.lang.Throwable t)
          Returns HTMLTemplate for error page with filling insertion tags, "CLASS.NAME" and "MESSAGE" with the information held in the passed Throwable object.
 int getIntCookieValue(java.lang.String name)
          Returns value of specified cookie.
 int getIntParameter(java.lang.String name)
          Returns specified parameter value as int value.
 int getIntParameter(java.lang.String name, int default_value)
          Returns specified parameter value as int value.
 long getLongParameter(java.lang.String name)
          Returns specified parameter value as long value.
 long getLongParameter(java.lang.String name, long default_value)
          Returns specified parameter value as long value.
 java.lang.Object getOutput()
           
 java.lang.String getParameter(java.lang.String name)
          Returns specified parameter value string.
 java.util.Enumeration getParameterNames()
          Returns parameter names.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns specified parameter value string array.
 javax.servlet.http.Cookie[] getRawCookies()
          Returns "NOT" decoded cookies.
 java.lang.String getSessionID()
          Returns the session ID.
 java.lang.Object getSessionValue(java.lang.String name)
          Returns the named value on session.
 java.lang.String[] getSessionValueNames()
          Returns the names of value on session.
 short getShortParameter(java.lang.String name, int default_value)
          Returns specified parameter value as short value.
 HTMLTemplate getTemplate(java.lang.String name)
          Loads specified HTML template file.
 void init()
          Empty method.
 void init(EZServletConfig config, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 void invalidateSession()
          Invalidates the session.
 void sendRedirect(java.lang.String url)
          Redirects a request to the specified url with HttpServlet.Response.encodeRedirectUrl (String).
 void setOutput(java.lang.Object output)
          Sets the "output" as an HTML source.
 void setSessionValue(java.lang.String name, java.lang.Object value)
          Sets the named value on sesison.
 void setTagValueWithParameters(HTMLTemplate template)
          全てのHTTPパラメタの値を使用して、パラメタと同じ名前のタグをパラメタ値で置換する。
 
クラス com.ngMAT.Common.ngmObject から継承したメソッド
clone, debug, equals_n, getLog, getProperties, getProperty, setLog, setNgmObject, setProperties
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

config

protected EZServletConfig config

req

protected javax.servlet.http.HttpServletRequest req

res

protected javax.servlet.http.HttpServletResponse res

cookies

protected java.util.Hashtable cookies

cookies_count

protected int cookies_count

new_cookies

protected java.util.Hashtable new_cookies

new_cookies_vector

protected java.util.Vector new_cookies_vector

output

protected java.lang.Object output
Output object.This must be an instance of java.lang.String or com.ngMAT.HTML.HTMLTetmplate.
コンストラクタの詳細

EZServletContext

public EZServletContext()
メソッドの詳細

getConfig

public EZServletConfig getConfig()

createContext

public static EZServletContext createContext(EZServletConfig config,
                                             javax.servlet.http.HttpServletRequest req,
                                             javax.servlet.http.HttpServletResponse res)

init

public final void init(EZServletConfig config,
                       javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse res)

init

public void init()
Empty method. You can override this method if you need other initialization for the context.

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns specified parameter value string. The value is already converted into UNICODE from the character set specified by "Servlet.Request.Charset" in your properties files.

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns specified parameter value string array. The value is already converted into UNICODE from the character set specified by "Servlet.Request.Charset" in your properties files.

getParameterNames

public java.util.Enumeration getParameterNames()
Returns parameter names.

getIntParameter

public int getIntParameter(java.lang.String name)
Returns specified parameter value as int value. When the parameter isn't found, NullPointerException will be thrown.

getLongParameter

public long getLongParameter(java.lang.String name)
Returns specified parameter value as long value. When the parameter isn't found, NullPointerException will be thrown.

getBooleanParameter

public boolean getBooleanParameter(java.lang.String name)
Returns specified parameter value as boolean value.

getShortParameter

public short getShortParameter(java.lang.String name,
                               int default_value)
Returns specified parameter value as short value. When the parameter isn't found, default value will be returned.

getBooleanParameter

public boolean getBooleanParameter(java.lang.String name,
                                   boolean default_value)
Returns specified parameter value as boolean value. When the parameter isn't found, default value will be returned.

getIntParameter

public int getIntParameter(java.lang.String name,
                           int default_value)
Returns specified parameter value as int value. When the parameter isn't found, default value will be returned.

getLongParameter

public long getLongParameter(java.lang.String name,
                             long default_value)
Returns specified parameter value as long value. When the parameter isn't found, default value will be returned.

getCookieValue

public java.lang.String getCookieValue(java.lang.String name)
Returns value of specified cookie.

getCookies

public javax.servlet.http.Cookie[] getCookies()
Returns decoded cookies.

getRawCookies

public javax.servlet.http.Cookie[] getRawCookies()
Returns "NOT" decoded cookies.

getIntCookieValue

public int getIntCookieValue(java.lang.String name)
Returns value of specified cookie. If its's not found, NullPointerException will be thrown.

addCookie

public void addCookie(java.lang.String name,
                      java.lang.String value)
Adds a cookie to send. When you modify the value of cookie which you get with getCookieValue (String) or getIntCookieValue (String), you have to call this method to validate its modification.

addCookie

public void addCookie(java.lang.String name,
                      java.lang.String value,
                      java.lang.String path)
Adds a cookie to send. When you modify the value of cookie which you get with getCookieValue (String) or getIntCookieValue (String), you have to call this method to validate its modification.

addCookie

public void addCookie(java.lang.String name,
                      java.lang.String value,
                      int max_age)
Adds a cookie to send. When you modify the value of cookie which you get with getCookieValue (String) or getIntCookieValue (String), you have to call this method to validate its modification.

addCookie

public void addCookie(java.lang.String name,
                      java.lang.String value,
                      java.lang.String path,
                      int max_age)
Adds a cookie to send. When you modify the value of cookie which you get with getCookieValue (String) or getIntCookieValue (String), you have to call this method to validate its modification.

createCookieString

public java.lang.String createCookieString(javax.servlet.http.Cookie cookie)
Cookieを文字コード変換を伴い、文字列表現に変換する。

getSessionValue

public java.lang.Object getSessionValue(java.lang.String name)
Returns the named value on session. When not found, null will be returned.

getSessionValueNames

public java.lang.String[] getSessionValueNames()
Returns the names of value on session.

getSessionID

public java.lang.String getSessionID()
Returns the session ID.

invalidateSession

public void invalidateSession()
Invalidates the session.

setSessionValue

public void setSessionValue(java.lang.String name,
                            java.lang.Object value)
Sets the named value on sesison.

getTemplate

public HTMLTemplate getTemplate(java.lang.String name)
Loads specified HTML template file. "name" should be the relative path from the template folder/directory specified by the property "EZServlet.TemplateFolder".

setOutput

public void setOutput(java.lang.Object output)
Sets the "output" as an HTML source.

getOutput

public java.lang.Object getOutput()

sendRedirect

public void sendRedirect(java.lang.String url)
Redirects a request to the specified url with HttpServlet.Response.encodeRedirectUrl (String). EZSResponseWasRedirectedException will be thrown everytime you call this method.

getErrorHTML

public HTMLComponent getErrorHTML(java.lang.Throwable t)
Returns HTMLTemplate for error page with filling insertion tags, "CLASS.NAME" and "MESSAGE" with the information held in the passed Throwable object.

debug

public static void debug(java.lang.String s)

setTagValueWithParameters

public void setTagValueWithParameters(HTMLTemplate template)
全てのHTTPパラメタの値を使用して、パラメタと同じ名前のタグをパラメタ値で置換する。text/password/hidden のINPUTタグ以外の値については、適切にセットされない可能性がある。パラメタのうち、その名称をもつタグが 見つからない場合は、何もしない。Set tag values with HTTP parameters whose name is the same as tags. INPUT tags other than text, password or hidden wouldn't be replaced as expected. Parameters no tags have the same name will be ignored.


バグや機能要求の報告
最新の情報
Copyright 2000 - ngMAT Corporation