KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > portal > generic > HttpPortletConnection


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  * Copyright (c) 2001-2004 Caucho Technology, Inc. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * 3. The end-user documentation included with the redistribution, if
19  * any, must include the following acknowlegement:
20  * "This product includes software developed by the
21  * Caucho Technology (http://www.caucho.com/)."
22  * Alternately, this acknowlegement may appear in the software itself,
23  * if and wherever such third-party acknowlegements normally appear.
24  *
25  * 4. The names "Hessian", "Resin", and "Caucho" must not be used to
26  * endorse or promote products derived from this software without prior
27  * written permission. For written permission, please contact
28  * info@caucho.com.
29  *
30  * 5. Products derived from this software may not be called "Resin"
31  * nor may "Resin" appear in their names without prior written
32  * permission of Caucho Technology.
33  *
34  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
35  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
36  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37  * DISCLAIMED. IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS
38  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
39  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
40  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
41  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
43  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
44  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  *
46  * @author Sam
47  */

48
49
50 package com.caucho.portal.generic;
51
52 import javax.portlet.PortletContext;
53 import javax.portlet.PortletRequest;
54 import javax.portlet.PortletSecurityException;
55 import javax.portlet.PortletSession;
56 import javax.servlet.http.HttpServletRequest JavaDoc;
57 import javax.servlet.http.HttpServletResponse JavaDoc;
58 import javax.servlet.http.HttpSession JavaDoc;
59 import java.io.BufferedReader JavaDoc;
60 import java.io.IOException JavaDoc;
61 import java.io.InputStream JavaDoc;
62 import java.io.OutputStream JavaDoc;
63 import java.io.PrintWriter JavaDoc;
64 import java.io.UnsupportedEncodingException JavaDoc;
65 import java.security.Principal JavaDoc;
66 import java.util.Enumeration JavaDoc;
67 import java.util.LinkedHashSet JavaDoc;
68 import java.util.Locale JavaDoc;
69 import java.util.Set JavaDoc;
70
71
72 /**
73  * A connection to an HttpServletRequest and HttpServletResponse.
74  */

75 public class HttpPortletConnection
76   extends PortletConnection
77 {
78   /**
79    * request attribute for the HttpServletRequest
80    */

81   final static public String JavaDoc HTTP_SERVLET_REQUEST
82     = HttpPortletRequestDispatcher.HTTP_SERVLET_REQUEST;
83
84   /**
85    * request attribute for the HttpServletResponse
86    */

87   final static public String JavaDoc HTTP_SERVLET_RESPONSE
88     = HttpPortletRequestDispatcher.HTTP_SERVLET_RESPONSE;
89
90   public static HttpServletRequest JavaDoc getHttpRequest(PortletRequest request)
91   {
92     return (HttpServletRequest JavaDoc) request.getAttribute(HTTP_SERVLET_REQUEST);
93   }
94
95   public static HttpServletResponse JavaDoc getHttpResponse(PortletRequest request)
96   {
97     return (HttpServletResponse JavaDoc) request.getAttribute(HTTP_SERVLET_RESPONSE);
98   }
99
100   private PortletContext _portletContext;
101   private HttpServletRequest JavaDoc _httpRequest;
102   private HttpServletResponse JavaDoc _httpResponse;
103
104   private Object JavaDoc _oldHttpRequest;
105   private Object JavaDoc _oldHttpResponse;
106
107   private String JavaDoc _servletUrl;
108
109   private MapBasedInvocationFactory _createdInvocationFactory;
110
111   private HttpPortletSession _portletSession;
112
113   private Set JavaDoc<Locale JavaDoc> _clientLocales;
114   private Set JavaDoc<String JavaDoc> _clientCharacterEncodings;
115   private Set JavaDoc<String JavaDoc> _clientContentTypes;
116
117   private boolean _isLocaleEstablished;
118   private boolean _isContentTypeEstablished;
119
120   public HttpPortletConnection()
121   {
122   }
123
124   public void start(Portal portal,
125                     PortletContext portletContext,
126                     HttpServletRequest JavaDoc httpRequest,
127                     HttpServletResponse JavaDoc httpResponse,
128                     boolean useParameters)
129   {
130     if (_createdInvocationFactory != null)
131       throw new IllegalStateException JavaDoc("missing finish?");
132
133     _createdInvocationFactory = new MapBasedInvocationFactory();
134
135     if (useParameters)
136       _createdInvocationFactory.start(httpRequest.getParameterMap());
137     else
138       _createdInvocationFactory.start(null);
139
140     start(portal,
141           portletContext,
142           httpRequest,
143           httpResponse,
144           _createdInvocationFactory);
145   }
146
147   public void start(Portal portal,
148                     PortletContext portletContext,
149                     HttpServletRequest JavaDoc httpRequest,
150                     HttpServletResponse JavaDoc httpResponse,
151                     InvocationFactory invocationFactory)
152   {
153     super.start(portal, invocationFactory);
154
155     _portletContext = portletContext;
156     _httpRequest = httpRequest;
157     _httpResponse = httpResponse;
158
159     _oldHttpRequest = _httpRequest.getAttribute(HTTP_SERVLET_REQUEST);
160
161     if (_oldHttpRequest != null)
162       _oldHttpResponse=_httpRequest.getAttribute(HTTP_SERVLET_RESPONSE);
163
164     _httpRequest.setAttribute(HTTP_SERVLET_REQUEST, _httpRequest);
165     _httpRequest.setAttribute(HTTP_SERVLET_RESPONSE, _httpResponse);
166
167     _servletUrl = makeServletUrl(_httpRequest);
168   }
169
170
171   protected String JavaDoc makeServletUrl(HttpServletRequest JavaDoc request)
172   {
173     String JavaDoc scheme = request.getScheme();
174     String JavaDoc serverName = request.getServerName();
175     int port = request.getServerPort();
176
177     if (port == 80 && scheme.equals("http"))
178       port = -1;
179
180     if (port == 443 && scheme.equals("https"))
181       port = -1;
182
183     String JavaDoc contextPath
184       = (String JavaDoc) request.getAttribute("javax.servlet.include.context_path");
185
186     String JavaDoc servletPath;
187
188     if (contextPath == null) {
189       contextPath = request.getContextPath();
190       servletPath = request.getServletPath();
191     }
192     else {
193       servletPath = (String JavaDoc) request.getAttribute("javax.servlet.include.servlet_path");
194     }
195
196     StringBuffer JavaDoc buf = new StringBuffer JavaDoc(256);
197
198     buf.append(scheme);
199     buf.append("://");
200     buf.append(serverName);
201     if (port > 0) {
202       buf.append(':');
203       buf.append(port);
204     }
205     buf.append(contextPath);
206     buf.append(servletPath);
207
208     return buf.toString();
209   }
210
211   public void finish()
212   {
213     int expirationCache = getExpirationCache();
214
215     if (expirationCache == 0) {
216       _httpResponse.setHeader( "Cache-Control",
217                                "no-cache,post-check=0,pre-check=0" );
218
219       _httpResponse.setHeader("Pragma", "no-cache");
220       _httpResponse.setHeader("Expires", "Thu,01Dec199416:00:00GMT");
221     }
222     else {
223       if (isPrivate()) {
224         _httpResponse.setHeader( "Cache-Control",
225                                  "private,max-age=" + expirationCache );
226       }
227       else {
228         _httpResponse.setHeader( "Cache-Control",
229                                  "max-age=" + expirationCache );
230       }
231     }
232
233     _isLocaleEstablished = false;
234     _isContentTypeEstablished = false;
235
236     _clientLocales = null;
237     _clientCharacterEncodings = null;
238     _clientContentTypes = null;
239
240     PortletContext portletContext = _portletContext;
241     MapBasedInvocationFactory createdInvocationFactory
242       = _createdInvocationFactory;
243     HttpServletRequest JavaDoc httpRequest = _httpRequest;
244     Object JavaDoc oldHttpRequest = _oldHttpRequest;
245     HttpServletResponse JavaDoc httpResponse = _httpResponse;
246     Object JavaDoc oldHttpResponse = _oldHttpResponse;
247     HttpPortletSession portletSession = _portletSession;
248
249     _servletUrl = null;
250
251     _portletContext = null;
252     _portletSession = null;
253     _oldHttpRequest = null;
254     _oldHttpResponse = null;
255     _createdInvocationFactory = null;
256     _httpRequest = null;
257     _httpResponse = null;
258
259     httpRequest.setAttribute(HTTP_SERVLET_RESPONSE, oldHttpResponse);
260     httpRequest.setAttribute(HTTP_SERVLET_REQUEST, oldHttpRequest);
261
262     super.finish();
263
264     if (portletSession != null)
265       portletSession.finish();
266
267     if (createdInvocationFactory != null)
268       createdInvocationFactory.finish();
269   }
270
271   public HttpServletRequest JavaDoc getHttpRequest()
272   {
273     return _httpRequest;
274   }
275
276   public HttpServletResponse JavaDoc getHttpResponse()
277   {
278     return _httpResponse;
279   }
280
281
282   /**
283    * Get the content types acceptable to the client. The returned Set
284    * is ordered, the most preferrable content types appear before the least
285    * preferred.
286    *
287    * This implementation returns the content types that appear in the
288    * String returned by getProperty("Accept") in the order
289    * they appear in the string.
290    *
291    * @return the Set, null if client content types cannot be determined
292    */

293   public Set JavaDoc<String JavaDoc> getClientContentTypes()
294   {
295     if (_clientContentTypes != null)
296       return _clientContentTypes;
297
298     _clientContentTypes = HttpUtil.getHeaderElements(getProperty("Accept"));
299
300     return _clientContentTypes;
301   }
302
303   /**
304    * Get the locales acceptable to the client. The returned Set is ordered,
305    * the most preferrable locale appears before the least preferred. If the
306    * client supports all locales, then a Locale("","","") will be present in
307    * the returned Set.
308    *
309    * This implementation returns the locales that appear in the String returned
310    * by getProperty("Accept-Language") in the order they appear in the
311    * string. If the "*" element is present in the header, then a new
312    * Locale("","","") is present in the set.
313    *
314    * @return the Set, null if client locales cannot be determined
315    */

316   public Set JavaDoc<Locale JavaDoc> getClientLocales()
317   {
318     if (_clientLocales != null)
319       return _clientLocales;
320
321     _clientLocales = new LinkedHashSet JavaDoc<Locale JavaDoc>();
322     _clientLocales.add(_httpRequest.getLocale());
323     
324     Enumeration JavaDoc en = _httpRequest.getLocales();
325
326     while (en.hasMoreElements()) {
327       _clientLocales.add( (Locale JavaDoc) en.nextElement() );
328     }
329
330
331     return _clientLocales;
332   }
333
334   /**
335    * Get the character encodings acceptable to the client. The returned Set is
336    * order, the most preferrable character encoding appears before the least
337    * preferred.
338    *
339    * This implementation returns the character encodings that appear in the
340    * String returned by getProperty("Accept-Charset") in the order
341    * they appear in the string.
342    *
343    * @return the Set, null if client character encodings cannot be determined
344    */

345   public Set JavaDoc<String JavaDoc> getClientCharacterEncodings()
346   {
347     if (_clientCharacterEncodings != null)
348       return _clientCharacterEncodings;
349
350     _clientCharacterEncodings
351       = HttpUtil.getHeaderElements(getProperty("Accept-Charset"));
352
353     return _clientCharacterEncodings;
354   }
355
356   public String JavaDoc resolveURL(String JavaDoc url)
357   {
358     StringBuffer JavaDoc buf = new StringBuffer JavaDoc(256);
359     appendUrlPrefix(_httpRequest, buf);
360     buf.append(url);
361     return buf.toString();
362   }
363
364   /**
365    * Resolve the url with the given security level and encode it.
366    *
367    * This implementation calls resolveURL(String) if <i>secure</i>
368    * is <code>false</code>.
369    *
370    * If <i>secure</i> is <code>true</code>, the prefix set with
371    * setSecureUrlPrefix() is prepended.
372    *
373    * @throws PortletSecurityException if secure is true but the url
374    * cannot be made secure because setSecureUrlPrefix() has not been called.
375    */

376   public String JavaDoc resolveURL(String JavaDoc url, boolean secure)
377     throws PortletSecurityException
378   {
379     if (secure == false)
380       return resolveURL(url);
381     else {
382       StringBuffer JavaDoc buf = new StringBuffer JavaDoc(256);
383
384       appendSecureUrlPrefix(_httpRequest, buf);
385       buf.append(url);
386       return buf.toString();
387     }
388   }
389
390   private String JavaDoc appendUrlPrefix(HttpServletRequest JavaDoc request, StringBuffer JavaDoc buf)
391   {
392     buf.append(_servletUrl);
393     return buf.toString();
394   }
395
396   private String JavaDoc appendSecureUrlPrefix( HttpServletRequest JavaDoc request,
397                                         StringBuffer JavaDoc buf )
398     throws PortletSecurityException
399   {
400     // XXX:
401

402     if (request.isSecure())
403       return appendUrlPrefix(request, buf);
404     else
405       throw new PortletSecurityException("cannot make url secure");
406   }
407
408   public boolean handleConstraintFailure( Constraint constraint,
409                                           int failureCode )
410     throws IOException JavaDoc
411   {
412     if (failureCode == Constraint.SC_FORBIDDEN) {
413       _httpResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
414     }
415     else {
416       _httpResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
417     }
418
419     return true;
420   }
421
422   public boolean handleException(Exception JavaDoc exception)
423   {
424     return false;
425   }
426   
427   /**
428    * Return true if the connection can guarantee integrity
429    * (preventing data tampering in the communication process).
430    */

431   public boolean canGuaranteeIntegrity()
432   {
433     return isSecure();
434   }
435
436   /**
437    * Return true if the connection can guarantee confidentiality (preventing
438    * reading while in transit).
439    */

440   public boolean canGuaranteeConfidentiality()
441   {
442     return isSecure();
443   }
444
445   /**
446    * Attributes for the connection are HttpServletRequest attributes.
447    */

448   public Object JavaDoc getAttribute(String JavaDoc name)
449   {
450     return _httpRequest.getAttribute(name);
451   }
452
453   /**
454    * Attributes for the connection are HttpServletRequest attributes.
455    */

456   public void setAttribute(String JavaDoc name, Object JavaDoc o)
457   {
458     _httpRequest.setAttribute(name,o);
459   }
460
461   /**
462    * Attributes for the connection are HttpServletRequest attributes.
463    */

464   public void removeAttribute(String JavaDoc name)
465   {
466     _httpRequest.removeAttribute(name);
467   }
468
469   /**
470    * Attributes for the connection are HttpServletRequest attributes.
471    */

472   public Enumeration JavaDoc getAttributeNames()
473   {
474     return _httpRequest.getAttributeNames();
475   }
476
477   public PortletSession getPortletSession(boolean create)
478   {
479     if (_portletSession != null)
480       return _portletSession;
481
482     HttpSession JavaDoc httpSession = _httpRequest.getSession(create);
483
484     if (httpSession != null) {
485       // XXX: pool these
486
_portletSession = new HttpPortletSession();
487       _portletSession.start(_portletContext, httpSession);
488     }
489
490     return _portletSession;
491   }
492
493   public String JavaDoc getScheme()
494   {
495     return _httpRequest.getScheme();
496   }
497
498   public String JavaDoc getServerName()
499   {
500     return _httpRequest.getServerName();
501   }
502
503   public int getServerPort()
504   {
505     return _httpRequest.getServerPort();
506   }
507
508   public String JavaDoc getContextPath()
509   {
510     return _httpRequest.getContextPath();
511   }
512
513   public String JavaDoc getAuthType()
514   {
515     String JavaDoc authType = _httpRequest.getAuthType();
516     
517     if (authType == null)
518       return null;
519     else if (authType == HttpServletRequest.BASIC_AUTH)
520       return PortletRequest.BASIC_AUTH;
521     /** XXX: bug in caucho impl of jsdk
522     else if (authType == HttpServletRequest.CLIENT_CERT_AUTH)
523       return PortletRequest.CLIENT_CERT_AUTH;
524       */

525     else if (authType == HttpServletRequest.DIGEST_AUTH)
526       return PortletRequest.DIGEST_AUTH;
527     else if (authType == HttpServletRequest.FORM_AUTH)
528       return PortletRequest.FORM_AUTH;
529     else if (authType.equals(HttpServletRequest.BASIC_AUTH))
530       return PortletRequest.BASIC_AUTH;
531     else if (authType.equals("CLIENT_CERT")) // XXX: bug in caucho impl of jsdk
532
return PortletRequest.CLIENT_CERT_AUTH;
533     else if (authType.equals(HttpServletRequest.DIGEST_AUTH))
534       return PortletRequest.DIGEST_AUTH;
535     else if (authType.equals(HttpServletRequest.FORM_AUTH))
536       return PortletRequest.FORM_AUTH;
537     else
538       return authType;
539   }
540
541   public boolean isSecure()
542   {
543     return _httpRequest.isSecure();
544   }
545
546   public String JavaDoc getRequestedSessionId()
547   {
548     return _httpRequest.getRequestedSessionId();
549   }
550
551   public boolean isRequestedSessionIdValid()
552   {
553     return _httpRequest.isRequestedSessionIdValid();
554   }
555
556   public String JavaDoc getRemoteUser()
557   {
558     return _httpRequest.getRemoteUser();
559   }
560
561   public Principal JavaDoc getUserPrincipal()
562   {
563     return _httpRequest.getUserPrincipal();
564   }
565
566   public boolean isUserInRole(String JavaDoc role)
567   {
568     return _httpRequest.isUserInRole(role);
569   }
570
571   public String JavaDoc getProperty(String JavaDoc propertyName)
572   {
573     return _httpRequest.getHeader(propertyName);
574   }
575
576   public Enumeration JavaDoc getProperties(String JavaDoc propertyName)
577   {
578     return _httpRequest.getHeaders(propertyName);
579   }
580
581   public Enumeration JavaDoc getPropertyNames()
582   {
583     return _httpRequest.getHeaderNames();
584   }
585
586   public String JavaDoc getSubmitContentType()
587   {
588     return _httpRequest.getContentType();
589   }
590
591   public int getSubmitContentLength()
592   {
593     return _httpRequest.getContentLength();
594   }
595
596   public InputStream JavaDoc getSubmitInputStream()
597     throws IOException JavaDoc
598   {
599     return _httpRequest.getInputStream();
600   }
601
602   public void setSubmitCharacterEncoding(String JavaDoc enc)
603     throws UnsupportedEncodingException JavaDoc, IllegalStateException JavaDoc
604   {
605     _httpRequest.setCharacterEncoding(enc);
606   }
607
608   public String JavaDoc getSubmitCharacterEncoding()
609   {
610     return _httpRequest.getCharacterEncoding();
611   }
612
613   public BufferedReader JavaDoc getSubmitReader()
614     throws UnsupportedEncodingException JavaDoc, IOException JavaDoc
615   {
616     return _httpRequest.getReader();
617   }
618
619   /**
620    * A path with a schem is encoded only.
621    *
622    * A relative location (does not start with slash) is resolved relative to
623    * the servlet path and then encoded.
624    *
625    * An absolute url (begins with slash) is resolved relative to
626    * the context path and then encoded.
627    */

628   public String JavaDoc encodeURL(String JavaDoc location)
629   {
630     int slash = location.indexOf('/');
631     int colon = location.indexOf(':');
632
633     if (colon == -1 || slash < colon ) {
634
635       String JavaDoc scheme = _httpRequest.getScheme();
636       String JavaDoc serverName = _httpRequest.getServerName();
637       int port = _httpRequest.getServerPort();
638
639       if (port == 80 && scheme.equals("http"))
640         port = -1;
641
642       if (port == 443 && scheme.equals("https"))
643         port = -1;
644
645       String JavaDoc contextPath = (String JavaDoc) _httpRequest.getAttribute("javax.servlet.include.context_path");
646       String JavaDoc servletPath = null;
647
648       if (contextPath == null) {
649         contextPath = _httpRequest.getContextPath();
650         servletPath = _httpRequest.getServletPath();
651       }
652
653       StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
654
655       buf.append(scheme);
656       buf.append("://");
657       buf.append(serverName);
658
659       if (port > 0) {
660         buf.append(':');
661         buf.append(port);
662       }
663
664       buf.append(contextPath);
665
666       if ( slash != 0 ) {
667
668         if (servletPath == null)
669           servletPath = (String JavaDoc) _httpRequest.getAttribute("javax.servlet.include.servlet_path");
670
671         buf.append(servletPath);
672
673         buf.append('/');
674
675         buf.append(location);
676       }
677       else {
678         buf.append(location);
679       }
680
681     
682       location = buf.toString();
683     }
684
685     return _httpResponse.encodeURL(location);
686   }
687
688   public void sendRedirect(String JavaDoc location)
689     throws IOException JavaDoc
690   {
691     String JavaDoc url = _httpResponse.encodeRedirectURL(location);
692
693     _httpResponse.sendRedirect(url);
694   }
695
696   public void setProperty(String JavaDoc name, String JavaDoc value)
697   {
698     _httpResponse.setHeader(name, value);
699   }
700
701   public void addProperty(String JavaDoc name, String JavaDoc value)
702   {
703     _httpResponse.addHeader(name, value);
704   }
705
706   public void setContentType(String JavaDoc contentType)
707   {
708     _isContentTypeEstablished = true;
709     _httpResponse.setContentType(contentType);
710   }
711
712   /**
713    * Return the content type established with setContentType(), or null if
714    * setContentType() has not been called.
715    */

716   public String JavaDoc getContentType()
717   {
718     if (_isContentTypeEstablished)
719       return _httpResponse.getContentType();
720     else
721       return null;
722   }
723
724   public void setLocale(Locale JavaDoc locale)
725   {
726     _isLocaleEstablished = true;
727     _httpResponse.setLocale(locale);
728   }
729
730   /**
731    * Return the Locale established with setLocale(), or null if setLocale()
732    * has not been called.
733    */

734   public Locale JavaDoc getLocale()
735   {
736     if (_isLocaleEstablished)
737       return _httpResponse.getLocale();
738     else
739       return null;
740   }
741
742   public void setBufferSize(int size)
743   {
744     _httpResponse.setBufferSize(size);
745   }
746
747   public int getBufferSize()
748   {
749     return _httpResponse.getBufferSize();
750   }
751
752   public void flushBuffer()
753     throws IOException JavaDoc
754   {
755     _httpResponse.flushBuffer();
756   }
757
758   public void resetBuffer()
759   {
760     _httpResponse.resetBuffer();
761   }
762
763   public void reset()
764   {
765     _httpResponse.reset();
766   }
767
768   public boolean isCommitted()
769   {
770     return _httpResponse.isCommitted();
771   }
772
773   public OutputStream JavaDoc getOutputStream()
774     throws IOException JavaDoc
775   {
776     return _httpResponse.getOutputStream();
777   }
778
779   public String JavaDoc getCharacterEncoding()
780   {
781     return _httpResponse.getCharacterEncoding();
782   }
783
784   public void setCharacterEncoding(String JavaDoc enc)
785     throws UnsupportedEncodingException JavaDoc
786   {
787     _httpResponse.setCharacterEncoding(enc);
788   }
789
790   public PrintWriter JavaDoc getWriter()
791     throws IOException JavaDoc
792   {
793     return _httpResponse.getWriter();
794   }
795
796 }
797
798
Popular Tags