1 11 12 package org.jivesoftware.util; 13 14 import javax.servlet.ServletContext ; 15 import javax.servlet.http.HttpServletRequest ; 16 import javax.servlet.http.HttpServletResponse ; 17 import javax.servlet.http.HttpSession ; 18 import javax.servlet.jsp.JspWriter ; 19 import javax.servlet.jsp.PageContext ; 20 21 public abstract class WebBean { 22 23 public HttpSession session; 24 public HttpServletRequest request; 25 public HttpServletResponse response; 26 public ServletContext application; 27 public JspWriter out; 28 29 public void init(HttpServletRequest request, HttpServletResponse response, 30 HttpSession session, ServletContext app, JspWriter 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 request, HttpServletResponse response, 40 HttpSession session, ServletContext 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 pageContext){ 49 this.request = (HttpServletRequest )pageContext.getRequest(); 50 this.response = (HttpServletResponse )pageContext.getResponse(); 51 this.session = (HttpSession )pageContext.getSession(); 52 this.application = (ServletContext )pageContext.getServletContext(); 53 this.out = (JspWriter )pageContext.getOut(); 54 } 55 } | Popular Tags |