WebBean.java 1.67 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
/**
 * $RCSfile$
 * $Revision$
 * $Date$
 *
 * Copyright (C) 2004 Jive Software. All rights reserved.
 *
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
 */

Matt Tucker's avatar
Matt Tucker committed
12 13 14 15 16 17 18
package org.jivesoftware.util;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspWriter;
19
import javax.servlet.jsp.PageContext;
Matt Tucker's avatar
Matt Tucker committed
20 21 22 23 24 25 26 27 28 29

public abstract class WebBean {

    public HttpSession session;
    public HttpServletRequest request;
    public HttpServletResponse response;
    public ServletContext application;
    public JspWriter out;

    public void init(HttpServletRequest request, HttpServletResponse response,
Matt Tucker's avatar
Matt Tucker committed
30 31
            HttpSession session, ServletContext app, JspWriter out)
    {
Matt Tucker's avatar
Matt Tucker committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
        this.request = request;
        this.response = response;
        this.session = session;
        this.application = app;
        this.out = out;
    }

    public void init(HttpServletRequest request, HttpServletResponse response,
                     HttpSession session, ServletContext app) {

        this.request = request;
        this.response = response;
        this.session = session;
        this.application = app;
    }
47 48 49 50 51 52 53 54

    public void init(PageContext pageContext){
        this.request = (HttpServletRequest)pageContext.getRequest();
        this.response = (HttpServletResponse)pageContext.getResponse();
        this.session = (HttpSession)pageContext.getSession();
        this.application = (ServletContext)pageContext.getServletContext();
        this.out = (JspWriter)pageContext.getOut();
    }
Matt Tucker's avatar
Matt Tucker committed
55
}