KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > util > WebBean


1 /**
2  * $RCSfile: WebBean.java,v $
3  * $Revision: 1.4 $
4  * $Date: 2004/12/27 02:54:13 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.util;
13
14 import javax.servlet.ServletContext JavaDoc;
15 import javax.servlet.http.HttpServletRequest JavaDoc;
16 import javax.servlet.http.HttpServletResponse JavaDoc;
17 import javax.servlet.http.HttpSession JavaDoc;
18 import javax.servlet.jsp.JspWriter JavaDoc;
19 import javax.servlet.jsp.PageContext JavaDoc;
20
21 public abstract class WebBean {
22
23     public HttpSession JavaDoc session;
24     public HttpServletRequest JavaDoc request;
25     public HttpServletResponse JavaDoc response;
26     public ServletContext JavaDoc application;
27     public JspWriter JavaDoc out;
28
29     public void init(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response,
30             HttpSession JavaDoc session, ServletContext JavaDoc app, JspWriter JavaDoc out)
31     {
32         this.request = request;
33         this.response = response;
34         this.session = session;
35         this.application = app;
36         this.out = out;
37     }
38
39     public void init(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response,
40                      HttpSession JavaDoc session, ServletContext JavaDoc app) {
41
42         this.request = request;
43         this.response = response;
44         this.session = session;
45         this.application = app;
46     }
47
48     public void init(PageContext JavaDoc pageContext){
49         this.request = (HttpServletRequest JavaDoc)pageContext.getRequest();
50         this.response = (HttpServletResponse JavaDoc)pageContext.getResponse();
51         this.session = (HttpSession JavaDoc)pageContext.getSession();
52         this.application = (ServletContext JavaDoc)pageContext.getServletContext();
53         this.out = (JspWriter JavaDoc)pageContext.getOut();
54     }
55 }
Popular Tags