Source Code Cross Referenced for JspUtil.java in  » EJB-Server-resin-3.1.5 » javadoc » com » caucho » doc » javadoc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » javadoc » com.caucho.doc.javadoc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998-2003 Caucho Technology -- all rights reserved
003:         *
004:         * Caucho Technology permits redistribution, modification and use
005:         * of this file in source and binary form ("the Software") under the
006:         * Caucho Developer Source License ("the License").  The following
007:         * conditions must be met:
008:         *
009:         * 1. Each copy or derived work of the Software must preserve the copyright
010:         *    notice and this notice unmodified.
011:         *
012:         * 2. Redistributions of the Software in source or binary form must include
013:         *    an unmodified copy of the License, normally in a plain ASCII text
014:         *
015:         * 3. The names "Resin" or "Caucho" are trademarks of Caucho Technology and
016:         *    may not be used to endorse products derived from this software.
017:         *    "Resin" or "Caucho" may not appear in the names of products derived
018:         *    from this software.
019:         *
020:         * This Software is provided "AS IS," without a warranty of any kind.
021:         * ALL EXPRESS OR IMPLIED REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
022:         * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
023:         * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
024:         *
025:         * CAUCHO TECHNOLOGY AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
026:         * SUFFERED BY LICENSEE OR ANY THIRD PARTY AS A RESULT OF USING OR
027:         * DISTRIBUTING SOFTWARE. IN NO EVENT WILL CAUCHO OR ITS LICENSORS BE LIABLE
028:         * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
029:         * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
030:         * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
031:         * INABILITY TO USE SOFTWARE, EVEN IF HE HAS BEEN ADVISED OF THE POSSIBILITY
032:         * OF SUCH DAMAGES.
033:         *
034:         * @author Sam 
035:         */
036:
037:        package com.caucho.doc.javadoc;
038:
039:        import com.caucho.log.Log;
040:        import com.caucho.util.L10N;
041:
042:        import java.util.logging.Logger;
043:
044:        import javax.servlet.http.HttpServletResponse;
045:        import javax.servlet.jsp.JspException;
046:        import javax.servlet.http.HttpServletRequest;
047:
048:        /**
049:         * Utilities common to all jsp pages.
050:         */
051:        public class JspUtil {
052:            static protected final Logger log = Log.open(JspUtil.class);
053:            static final L10N L = new L10N(JspUtil.class);
054:
055:            private HttpServletRequest _request;
056:            private HttpServletResponse _response;
057:
058:            private Store _store;
059:
060:            public JspUtil() {
061:            }
062:
063:            public void setRequest(HttpServletRequest request) {
064:                _request = request;
065:            }
066:
067:            public void setResponse(HttpServletResponse response) {
068:                _response = response;
069:            }
070:
071:            /**
072:             * Get the Store object.
073:             */
074:            public Store getStore() throws JspException {
075:                if (_store == null) {
076:                    try {
077:                        _store = Store.getInstance();
078:                    } catch (Exception ex) {
079:                        throw new JspException(ex);
080:                    }
081:                }
082:
083:                return _store;
084:            }
085:
086:            /**
087:             * Send appropriate HTTP cache headers based on the value of
088:             * http-cache-period for the Store.
089:             */
090:            public void sendHttpCacheHeaders() throws JspException {
091:                Store store = getStore();
092:
093:                long period = getStore().getHttpCachePeriod();
094:
095:                if (period < 0) {
096:                    // disable caching
097:                    _response.setHeader("Cache-Control",
098:                            "no-cache,post-check=0,pre-check=0,no-store");
099:                    _response.setHeader("Pragma", "no-cache");
100:                    _response.setHeader("Expires", "Thu,01Dec199416:00:00GMT");
101:                } else {
102:                    long now = System.currentTimeMillis();
103:                    _response.setDateHeader("Expires", now + period);
104:                }
105:            }
106:
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.