|
Eclipse Rich Ajax Platform Release 1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A service handler is responsible for taking a request and sending an appropriate response by bypassing the standard lifecycle. Clients are free to implement custom service handlers. Implementing a custom service handler involves three steps:
public class MyServiceHandler implements IServiceHandler { public void service() throws IOException, ServletException { HttpServletResponse response = ContextProvider.getResponse(); response.getWriter().write( "Hello World" ); } }
servicehandler.xml
.
<?xml version="1.0" encoding="UTF-8"?> <servicehandler> <handler class="org.demo.MyServiceHandler" requestparameter="myServiceHandler"/> </servicehandler>Each
servicehandler.xml
may contain any number of handler
entries.
http://localhost:9090/rap?custom_service_handler=myServiceHandler
.
The following example code snippet achieves this
StringBuffer url = new StringBuffer(); url.append( URLHelper.getURLString( false ) ); url.append( "?" ); url.append( IServiceHandler.REQUEST_PARAM ); url.append( "=myServiceHandler" ); String encodedURL = RWT.getResponse().encodeURL( url.toString() );
Field Summary | |
static String |
REQUEST_PARAM
The request parameter name to hold the service handlers name as its value (value is custom_service_handler). |
Method Summary | |
void |
service()
This method is called by the RAP lifecycle to allow the service handler to respond to a request. |
Field Detail |
public static final String REQUEST_PARAM
The request parameter name to hold the service handlers name as its value (value is custom_service_handler).
Method Detail |
public void service() throws IOException, ServletException
This method is called by the RAP lifecycle to allow the service handler to respond to a request.
IOException
ServletException
|
Eclipse Rich Ajax Platform Release 1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) Innoopract Informationssysteme GmbH and others 2002, 2008. All rights reserved.