Source Code Cross Referenced for JspFactoryImpl.java in  » J2EE » Sofia » com » salmonllc » jsp » engine » 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 » J2EE » Sofia » com.salmonllc.jsp.engine 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //** Copyright Statement ***************************************************
002:        //The Salmon Open Framework for Internet Applications (SOFIA)
003:        // Copyright (C) 1999 - 2002, Salmon LLC
004:        //
005:        // This program is free software; you can redistribute it and/or
006:        // modify it under the terms of the GNU General Public License version 2
007:        // as published by the Free Software Foundation;
008:        //
009:        // This program is distributed in the hope that it will be useful,
010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:        // GNU General Public License for more details.
013:        //
014:        // You should have received a copy of the GNU General Public License
015:        // along with this program; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:        //
018:        // For more information please visit http://www.salmonllc.com
019:        //** End Copyright Statement ***************************************************
020:        // ====================================================================
021:        //
022:        // The Apache Software License, Version 1.1
023:        //
024:        // Copyright (c) 1999 The Apache Software Foundation.  All rights
025:        // reserved.
026:        //
027:        // Redistribution and use in source and binary forms, with or without
028:        // modification, are permitted provided that the following conditions
029:        // are met:
030:        //
031:        // 1. Redistributions of source code must retain the above copyright
032:        //    notice, this list of conditions and the following disclaimer.
033:        //
034:        // 2. Redistributions in binary form must reproduce the above copyright
035:        //    notice, this list of conditions and the following disclaimer in
036:        //    the documentation and/or other materials provided with the
037:        //    distribution.
038:        //
039:        // 3. The end-user documentation included with the redistribution, if
040:        //    any, must include the following acknowlegement:
041:        //       "This product includes software developed by the
042:        //        Apache Software Foundation (http://www.apache.org/)."
043:        //    Alternately, this acknowlegement may appear in the software itself,
044:        //    if and wherever such third-party acknowlegements normally appear.
045:        //
046:        // 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
047:        //    Foundation" must not be used to endorse or promote products derived
048:        //    from this software without prior written permission. For written
049:        //    permission, please contact apache@apache.org.
050:        //
051:        // 5. Products derived from this software may not be called "Apache"
052:        //    nor may "Apache" appear in their names without prior written
053:        //    permission of the Apache Group.
054:        //
055:        //  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
056:        //  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
057:        //  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
058:        //  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
059:        //  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
060:        //  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
061:        //  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
062:        //  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
063:        //  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
064:        //  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
065:        //  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
066:        //  SUCH DAMAGE.
067:        //  ====================================================================
068:        //
069:        //  This software consists of voluntary contributions made by many
070:        //  individuals on behalf of the Apache Software Foundation.  For more
071:        //  information on the Apache Software Foundation, please see
072:        //  <http://www.apache.org/>.
073:
074:        package com.salmonllc.jsp.engine;
075:
076:        /////////////////////////
077:        //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/engine/JspFactoryImpl.java $
078:        //$Author: Dan $
079:        //$Revision: 15 $
080:        //$Modtime: 9/22/04 10:34a $
081:        /////////////////////////
082:        import javax.servlet.jsp.*;
083:        import javax.servlet.http.*;
084:
085:        import com.salmonllc.html.HttpServletResponseDummy;
086:        import com.salmonllc.jsp.*;
087:        import com.salmonllc.jsp.tags.PageTag;
088:
089:        /**
090:         * This class is an implementation of the J2EE JSP factory.
091:         * It is used by the JSPServlet to facilitate multiple passes
092:         * through the _jspservice method when a salmon JSP is initialized
093:         */
094:        public class JspFactoryImpl extends JspFactory {
095:            JspFactory _realFactory = null;
096:
097:            /**
098:             * Creates a new JSPFactory.
099:             * @param realFactory The real factory used by the J2EE Engine
100:             */
101:            public JspFactoryImpl(JspFactory realFactory) {
102:                super ();
103:                _realFactory = realFactory;
104:
105:            }
106:
107:            /**
108:             * Returns information on the J2EE Engine
109:             */
110:            public javax.servlet.jsp.JspEngineInfo getEngineInfo() {
111:                return _realFactory.getEngineInfo();
112:            }
113:
114:            /**
115:             * Creates a new page context
116:             */
117:            public javax.servlet.jsp.PageContext getPageContext(
118:                    javax.servlet.Servlet arg1,
119:                    javax.servlet.ServletRequest arg2,
120:                    javax.servlet.ServletResponse arg3, String arg4,
121:                    boolean arg5, int arg6, boolean arg7) {
122:                boolean isInitializing = true;
123:                boolean isContextSalmon = (arg1 instanceof  com.salmonllc.jsp.JspServlet);
124:                HttpServletRequest req = (HttpServletRequest) arg2;
125:
126:                String sessID = req
127:                        .getParameter(PageTag.getSessionIdentifier());
128:                HttpSession sess = PageTag.getSession(sessID);
129:                if (sess == null)
130:                    sess = req.getSession(false);
131:                JspController cont = null;
132:                if (sess != null) {
133:                    cont = (JspController) sess.getAttribute("$jsp$"
134:                            + com.salmonllc.jsp.tags.PageTag
135:                                    .generateSessionName(req));
136:                    if (cont != null) {
137:                        isInitializing = cont.isInitializing();
138:                        if (cont.getPageContext() != null)
139:                            isContextSalmon = (cont.getPageContext()
140:                                    .getResponse() instanceof  HttpServletResponseDummy);
141:                    }
142:                }
143:
144:                if (isInitializing && isContextSalmon)
145:                    return _realFactory.getPageContext(arg1, arg2,
146:                            new HttpServletResponseDummy(
147:                                    (HttpServletResponse) arg3, cont), arg4,
148:                            arg5, arg6, arg7);
149:                else
150:                    return _realFactory.getPageContext(arg1, arg2, arg3, arg4,
151:                            arg5, arg6, arg7);
152:
153:            }
154:
155:            /**
156:             * Frees the resources used by a page context object
157:             */
158:            public void releasePageContext(javax.servlet.jsp.PageContext arg1) {
159:                if (!(arg1 instanceof  com.salmonllc.jsp.engine.PageContextImpl))
160:                    _realFactory.releasePageContext(arg1);
161:                else
162:                    ((com.salmonllc.jsp.engine.PageContextImpl) arg1).release();
163:            }
164:
165:            /**
166:             * Resets the factory to the real one for the J2EE engine
167:             */
168:            public void resetFactory() {
169:                JspFactory.setDefaultFactory(_realFactory);
170:            }
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.