Decision Center API

ilog.webui.dhtml
Class IlxWController

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by ilog.webui.dhtml.IlxWController
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
IlxWDefaultController

public abstract class IlxWController
extends javax.servlet.http.HttpServlet
implements ilog.webui.dhtml.IlxWConstants

The controller servlet for the web components. This servlet manages communication between the client side and the server side of the Web Components.

When creating a Web Application using the web components, you must provide a controller servlet and give its path in the ilog.webui.dhtml.controller_path context parameter. You will typically provide this information in the WEB-INF/web.xml deployment descriptor of your Web Application (see Servlet 2.2 Specification for more details on Web Applications and deployment descriptors). The controller you provide must be a subclass of IlxWController, namely either the IlxWDefaultController class or your own subclass.
Here is an example of a controller servlet subclass:

... and typically, you reference this servlet in your WEB-INF/web.xml file as follows:

To understand how communication between the client side and the server side of a web component is managed, let's have a look at a scenario of a user interaction. Suppose a user performs an action on a Web browser, for instance, clicks on a link of the Syntactic Editor. When this action is performed, a JavaScript proxy method is called. This method first registers the data representing the modification applied to the component in a queue stored in the JavaScript environment of the client. We call this queue the modified component queue. Next time a request is sent to the controller servlet, the data of the modified component queue will be added to the request and the server-side ,component object will be updated accordingly. In this way, components are synchronized between their client side and their server side.

The major issue on the client side is whether to redisplay the HTML page or not. The JavaScript proxy applies modifications to the HTML page by evaluating the user action. There are three possible conditions that may arise:

When a modification of the component state is placed in the queue, the JavaScript proxy method evaluates the modification. If the component needs to be redisplayed through the server, the JavaScript proxy sends a request to the controller servlet. The send requests may be sent to the server via two different ways, depending on the web browser:

In this class, the service() method handles all requests regardless of their type. Overriding doGet, doPost, doPut, etc. has no effect.

See Also:
IlxWComponent, IlxWPort, IlxWManager, Serialized Form

Constructor Summary
IlxWController()
           
 
Method Summary
protected abstract  void handleError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, IlxWControllerError error, String requestPath)
          Handles the errors thrown by the service method of this servlet.
protected  void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Redefines HttpServlet.service().
 
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, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlxWController

public IlxWController()
Method Detail

service

protected void service(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse resp)
                throws javax.servlet.ServletException,
                       IOException
Redefines HttpServlet.service(). You should not have to redefine this method.

Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

handleError

protected abstract void handleError(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    IlxWControllerError error,
                                    String requestPath)
                             throws IOException,
                                    javax.servlet.ServletException
Handles the errors thrown by the service method of this servlet.

Throws:
IOException
javax.servlet.ServletException
Parameters:
error - The controller error object.
request - The current request.
response - The current response.
requestPath - The path of the request that has been called just before the servlet controller.

Decision Center API

© Copyright IBM Corp. 1987, 2013