com.bea.wlp.rest.servlet
Class RestServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.bea.wlp.rest.servlet.RestServlet
All Implemented Interfaces
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class RestServlet
extends javax.servlet.http.HttpServlet

Servlet class used to service REST requests to a WLP server. This servlet dispatches REST requests to any available installed Command sets, which are installed and configured via wlp-restapi-config.xml.

This servlet can optionally take an init_param that can be used to configure sub wlp-restapi-config.xml files if there is a need to modularize them. To use this functionality, add one or more init-params to the REST servlet element in web.xml with names of the form "rest_config_FOO" where FOO can be any unique string. The value of each of these init params should be the filename of the sub rest config file, such as "foo-rest-config.xml". Sub wlp-restapi-config.xml files may be packaged in jar files in WEB-INF directories as well as being directly placed in WEB-INF directory on the filesystem.

If the namespace functionality for REST commands is in use, the REST servlet should additionally be mapped to that namespace path in web.xml. For instance, if namespace "/my/rest" were definied for any command groups in wlp-restapi-config.xml, the REST servlet needs to be mapped to "/my/rest/*" in web.xml, as the servlet path is used to route namespaced commands within the servlet.

See Also
Serialized Form

Field Summary
static String CONFIG_DIR
           
static String CONFIG_PATH_PREFIX
           
 
Constructor Summary
RestServlet()
           
 
Method Summary
 void init()
           
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_PATH_PREFIX

public static final String CONFIG_PATH_PREFIX
See Also
Constants Summary

CONFIG_DIR

public static final String CONFIG_DIR
See Also
Constants Summary
Constructor Detail

RestServlet

public RestServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Overrides:
init in class javax.servlet.GenericServlet
Throws
javax.servlet.ServletException

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       IOException
Overrides:
service in class javax.servlet.http.HttpServlet
Throws
javax.servlet.ServletException
IOException


Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.