Controller

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openswing.swing.server
Class Controller

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.openswing.swing.server.Controller

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Controller
extends javax.servlet.http.HttpServlet

Title: OpenSwing Framework

Description: Server Controller (HTTP Servlet). It receives all client requests and dispatch them to the correct action class. This controller requires a user authentication before processing other requests: that request have method name: "login" The web.xml file must have the following parameters:

- "actionClasses" - i.e. the class name that collects all action classes; it must derive from "org.openswing.swing.server.ActionCollection"
- "connectionSource" - i.e. the class name that manages the database connections; it must implements "org.openswing.swing.server.ConnectionSource" class; possible values: "org.openswing.swing.server.DataSourceConnection", "org.openswing.swing.server.NoConnectionSource", "org.openswing.swing.server.PoolerConnectionSource"
- "resourceFactory" - i.e. the class name that defines the internationalization settings; it must implements "org.openswing.swing.internationalization.ServerResourcesFactory" class
- "sessionIdGenerator" - i.e. the class name that generated session identifiers; it must implements "org.openswing.swing.server.SessionIdGenerator" class; possible values: "org.openswing.swing.server.DefaultSessionIdGenerator"
- "logger" - i.e. the class name that manages the server log; it must implements "org.openswing.swing.logger.server.LoggerMethods" class; possible values: "org.openswing.swing.logger.server.ConsoleLogger", "org.openswing.swing.logger.server.Log4JLogger"
- "controllerCallbacks" - i.e. the class name that derives from ControllerCallbacks class; it must derive from "org.openswing.swing.server.ControllerCallbacks" class

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
  Serialized Form

Field Summary
`static java.lang.String` | `ACTION_CLASSES` action classes
`static java.lang.String` | `CONTROLLER_CALLBACKS` class that derives from ControllerCallbacks
`static java.lang.String` | `RESOURCES_FACTORY` identifier of internationalization settings (Resources object) stored in the servlet context
`static java.lang.String` | `SESSION_ID_GENERATOR` session identifiers generator
`static java.lang.String` | `SESSION_IDS` identifier of session identifiers stored in the servlet context
`static java.lang.String` | `USER_SESSIONS` identifier of user sessions info stored in the servlet context

Constructor Summary
`Controller()`

Method Summary
`void` | `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Process the HTTP GET request: this method is used to receive browser HTTP requests (like document requests...)
`void` | `doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Process the HTTP POST request: this method is coupled with ClientUtils.getData method.
`void` | `init()` Initialize global variables.

Methods inherited from class javax.servlet.http.HttpServlet
`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
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SESSION_IDS

    public static final java.lang.String SESSION_IDS

  identifier of session identifiers stored in the servlet context

  See Also:
    Constant Field Values

### USER_SESSIONS

    public static final java.lang.String USER_SESSIONS

  identifier of user sessions info stored in the servlet context

  See Also:
    Constant Field Values

### RESOURCES_FACTORY

    public static final java.lang.String RESOURCES_FACTORY

  identifier of internationalization settings (Resources object) stored in the servlet context

  See Also:
    Constant Field Values

### SESSION_ID_GENERATOR

    public static final java.lang.String SESSION_ID_GENERATOR

  session identifiers generator

  See Also:
    Constant Field Values

### ACTION_CLASSES

    public static final java.lang.String ACTION_CLASSES

  action classes

  See Also:
    Constant Field Values

### CONTROLLER_CALLBACKS

    public static final java.lang.String CONTROLLER_CALLBACKS

  class that derives from ControllerCallbacks

  See Also:
    Constant Field Values

Constructor Detail

### Controller

    public Controller()

Method Detail

### init

    public void init()
              throws javax.servlet.ServletException

  Initialize global variables.

  Throws:
    `javax.servlet.ServletException`

### doGet

    public void doGet(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException

  Process the HTTP GET request: this method is used to receive browser HTTP requests (like document requests...)

  Throws:
    `javax.servlet.ServletException`
    `java.io.IOException`

### doPost

    public void doPost(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException

  Process the HTTP POST request: this method is coupled with ClientUtils.getData method.

  Throws:
    `javax.servlet.ServletException`
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD