|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkr.co.hit.live.web.action.AbstractWebAction
kr.co.hit.live.web.json.JsonWebAction
public class JsonWebAction
JSON 기반의 데이터교환 및 서비스호출 기능을 구현하기 위한 WebAction 클래스이다.
이 클래스에서는 다음의 Diagnostic Context 값들을 생성한다.
| Field Summary | |
|---|---|
static String |
DEFAULT_CLIENT_MESSAGE_KEY
서버 처리 메시지가 없을 경우 전달할 디폴트 메시지 키 |
protected static String |
DEFAULT_CONTENT_TYPE
|
static String |
DEFAULT_DATA_KEY
서버 데이터를 전달하기 위한 디폴트 키명 |
protected static String |
DEFAULT_ENCODING
|
static String |
DEFAULT_MESSAGE_KEY
서버 처리 메시지를 전달하기 위한 디폴트 키명 |
static String |
DEFAULT_METHOD_SELECTOR
|
static String |
DEFAULT_SERVERTIME_KEY
서버 시간을 전달하기 위한 디폴트 키명 |
static String |
DEFAULT_SERVICE_SELECTOR
|
protected ServiceDelegator |
serviceDelegator
|
| Fields inherited from class kr.co.hit.live.web.action.AbstractWebAction |
|---|
context |
| Constructor Summary | |
|---|---|
JsonWebAction()
|
|
| Method Summary | |
|---|---|
WebActionForward |
execute(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
WebActionDispatcher 서블릿이 호출하는 메소드이다. |
protected JsonMessage |
handleMessage(JsonMessage jsonRequest)
JsonMessage 입력받아 서비스를 호출한다. |
protected JsonMessage |
readMessage(javax.servlet.http.HttpServletRequest request)
HTTP Request의 input stream을 deserialize하여 JsonMessage 객체를 생성하여 반환한다. |
void |
setDataKey(String key)
(옵션)서버 시간을 전달하기 위한 키명 Setter. - default: "svrtime" |
void |
setMessageKey(String key)
(옵션)서버 처리 메시지를 전달하기 위한 키명 Setter. - default: "message" |
void |
setMethodSelector(String methodSelector)
(옵션)HttpServletRequest에서 Service Object의 Method를 호출하기 위한 Method명에 대한 request Parameter 명을 지정한다. - default: "method" |
void |
setServiceDelegator(ServiceDelegator delegator)
주어진 ServiceDelegator를 사용하도록 설정한다. |
void |
setSvcSelector(String svcSelector)
(옵션)HttpServletRequest에서 Service Object를 호출 하기 위한 Service명에 대한 request Parameter 명을 지정한다. - default: "target" |
void |
setTimeKey(String key)
(옵션)서버 데이터를 전달하기 위한 키명 Setter. - default: "data" |
void |
showConfiguration(javax.servlet.http.HttpServletResponse response)
WebAction의 설정값을 출력하는 메소드이다. |
protected Object |
wrapResult(Object result)
서비스 결과값을 입력받아 전달 가능한 JSON Object으로 Wrapping 한다. |
protected Object |
wrapResult(Throwable thr)
에러 Exceptiong을 입력받아 전달 가능한 JSON Object으로 Wrapping 한다. |
protected void |
writeMessage(javax.servlet.http.HttpServletResponse response,
JsonMessage message)
JsonMessage 객체를 HTTP Response의 output stream으로 Json Object을 전송한다. |
| Methods inherited from class kr.co.hit.live.web.action.AbstractWebAction |
|---|
createForward, getServletContext, getWebApplicationContext, setForward, setPrefix, setSuffix, setWebApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ServiceDelegator serviceDelegator
public static final String DEFAULT_SERVICE_SELECTOR
public static final String DEFAULT_METHOD_SELECTOR
protected static final String DEFAULT_ENCODING
protected static final String DEFAULT_CONTENT_TYPE
public static final String DEFAULT_MESSAGE_KEY
public static final String DEFAULT_DATA_KEY
public static final String DEFAULT_SERVERTIME_KEY
public static final String DEFAULT_CLIENT_MESSAGE_KEY
| Constructor Detail |
|---|
public JsonWebAction()
| Method Detail |
|---|
public void showConfiguration(javax.servlet.http.HttpServletResponse response)
throws IOException
WebAction
showConfiguration in interface WebActionshowConfiguration in class AbstractWebActionIOExceptionpublic void setMessageKey(String key)
key - public void setDataKey(String key)
key - public void setTimeKey(String key)
key - public void setSvcSelector(String svcSelector)
svcSelector - public void setMethodSelector(String methodSelector)
methodSelector - public void setServiceDelegator(ServiceDelegator delegator)
delegator -
public WebActionForward execute(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws Exception
WebAction
execute in interface WebActionexecute in class AbstractWebActionException
protected JsonMessage readMessage(javax.servlet.http.HttpServletRequest request)
throws IOException,
ClassNotFoundException
request -
IOException
ClassNotFoundException
protected void writeMessage(javax.servlet.http.HttpServletResponse response,
JsonMessage message)
throws IOException
response - JsonMessage -
IOExceptionprotected JsonMessage handleMessage(JsonMessage jsonRequest)
jsonRequest - 처리할 메시지
protected Object wrapResult(Object result)
result - 서비스 호출 후 Object를 전달 가능한 JSON Object으로 Wrapping 한다.protected Object wrapResult(Throwable thr)
에러 - Exceptiong을 전달 가능한 JSON Object으로 Wrapping 한다.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||