Package appl.Portal.FwService.Servlet

Source Code of appl.Portal.FwService.Servlet.Fw_Servlet

/*
*  This software and supporting documentation were developed by
*
*    Siemens Corporate Technology
*    Competence Center Knowledge Management and Business Transformation
*    D-81730 Munich, Germany
*
*    Authors (representing a really great team ;-) )
*            Stefan B. Augustin, Thorbj�rn Hansen, Manfred Langen
*
*  This software is Open Source under GNU General Public License (GPL).
*  Read the text of this license in LICENSE.TXT
*  or look at www.opensource.org/licenses/
*
*  Once more we emphasize, that:
*  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  WITHOUT ANY WARRANTY
*  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE OR
*  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR
*  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
*  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
*
*/


// Fw_Servlet

// ************ package ******************************************************
package appl.Portal.FwService.Servlet;

// ************ imports ******************************************************

// This application/module packages
import appl.Portal.FwService.Servlet.Fw_Props;
import appl.Portal.FwService.GUI.*;

// Other application/module packages

// KFM packages
import KFM.Exceptions.KFMException;
import KFM.ServletFramework.*;
import KFM.Language;

// Library classes (JHDK, JSDK, RegExp, ...)
import javax.servlet.*;
import javax.servlet.http.*;

// Java packages
import java.io.*;



/** Servlet for communication with javascript framework.
* Provides stored gadget data for the framework.
*
* </p>
*
* @version 0.1 (00.12.12)
*/
public class Fw_Servlet extends KFM_PropertyServlet2
{

    // ************************************************************
    // Variables
    // ************************************************************

    /** The servlet properties.
     *
     * Shadows `super.mProps�, which is OK, as both refer to the same object.
     */
    protected Fw_Props mProps = null;

    int i = 0;

    // ************************************************************
    // Methods
    // ************************************************************

    /** Called by the web server when the servlet is just loaded, and
     *  after a destroy.
     *
     * This is the first method of the servlet that get's called.
     * It should initialize the servlet.
     * Currently, just read the servlet properties.
     *
     * @param config  The configuration information.
     *     We only expect one data, which is the configuration file to read,
     *     something like
     *     `configFile=o:/kfm/config/dev/santamaria/BM.properties�.
     */
    public void init (ServletConfig aConfig)
        throws ServletException
    {
        super.init(aConfig, mProps = new Fw_Props() /*sic*/);

    }

    public void doInit(ServletConfig aConfig)
        throws ServletException, NoSuchServletPropertyException, KFMException
    {
        // * Read the required and optional properties of `Ex3_Props�, which see.
        mProps.FrameworkLocation   = mProps.getRequired("FrameworkLocation");
    }

    /** Handle all HTTP request (escpecially `doGet� and `doPost�).
     *
     * This method is called for each HTTP requerst.
     * It Creates an applicationpage for each request and calls its `write�.
     * When we get user states etc. we cannot create a new applicationpage each time,
     * but don't worry about that yet.
     *
     * @param aReq  The POST or GET request information.
     * @param aRes  The HTTP response object.
     *
     * @exception ServletException
     * @exception IOException
     */
    public void processRequest2 (
        HttpServletRequest aReq,
        HttpServletResponse aRes)
        throws ServletException, IOException, KFMException
    {
        // Create a new ApplicationPage for each request. Really.
        Fw_ApplicationPage tP = new Fw_ApplicationPage(mProps, aReq);
        tP.setServletName(this);
        // try {
            tP.write(/*user state*/ null, aReq, aRes);
            aRes.getWriter().close();
        // } catch(Exception e) {
        //     PrintWriter tWriter = aRes.getWriter();
        //     tWriter.print(e.toString());
        //     tWriter.close();
        // }

        // Note that the ApplicationPage is thrown away. Really.
    }
}
TOP

Related Classes of appl.Portal.FwService.Servlet.Fw_Servlet

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.