Source Code Cross Referenced for HttpServletWrapper.java in  » Ajax » ItsNat » org » itsnat » core » http » 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 » Ajax » ItsNat » org.itsnat.core.http 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          ItsNat Java Web Application Framework
003:          Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004:          Author: Jose Maria Arranz Santamaria
005:
006:          This program is free software: you can redistribute it and/or modify
007:          it under the terms of the GNU Affero General Public License as published by
008:          the Free Software Foundation, either version 3 of the License, or
009:          (at your option) any later version. See the GNU Affero General Public 
010:          License for more details. See the copy of the GNU Affero General Public License
011:          included in this program. If not, see <http://www.gnu.org/licenses/>.
012:         */
013:
014:        package org.itsnat.core.http;
015:
016:        import java.io.IOException;
017:        import javax.servlet.ServletConfig;
018:        import javax.servlet.ServletException;
019:        import javax.servlet.http.HttpServlet;
020:        import javax.servlet.http.HttpServletRequest;
021:        import javax.servlet.http.HttpServletResponse;
022:        import org.itsnat.core.*;
023:
024:        /**
025:         * Simplifies the development of new ItsNat based servlets.
026:         *
027:         * <p>New servlets may inherit from this class and overload {@link #init(javax.servlet.ServletConfig config)} 
028:         * to setup the ItsNat infrastructure (default properties, register templates etc).</p>
029:         * 
030:         * <p>This class creates an ItsNat servlet wrapping this servlet and forwards 
031:         * request/response calls to the ItsNat servlet, these are converted to ItsNat 
032:         * request/response calls.</p>
033:         *
034:         * @author Jose Maria Arranz Santamaria
035:         */
036:        public abstract class HttpServletWrapper extends HttpServlet {
037:            protected ItsNatHttpServlet itsNatServlet;
038:
039:            /**
040:             * Creates a new instance of HttpServletWrapper
041:             */
042:            public HttpServletWrapper() {
043:            }
044:
045:            /**
046:             * Returns the ItsNat servlet wrapping this servlet.
047:             *
048:             * @return the ItsNat servlet.
049:             * @see ItsNatHttpServlet#getHttpServlet()
050:             */
051:            public ItsNatHttpServlet getItsNatHttpServlet() {
052:                return itsNatServlet;
053:            }
054:
055:            /**
056:             * Initializes the ItsNat servlet wrapping this servlet. Overload this method
057:             * to initialize the ItsNat servlet (setup properties, register templates etc).
058:             */
059:            public void init(ServletConfig config) throws ServletException {
060:                super .init(config);
061:
062:                this .itsNatServlet = (ItsNatHttpServlet) ItsNat.get()
063:                        .createItsNatServlet(this );
064:            }
065:
066:            /**
067:             * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods
068:             * and forwards them to the {@link ItsNatHttpServlet}.
069:             * 
070:             * @param request servlet request object.
071:             * @param response servlet response object.
072:             */
073:            protected void processRequest(HttpServletRequest request,
074:                    HttpServletResponse response) throws ServletException,
075:                    IOException {
076:                getItsNatHttpServlet().processRequest(request, response);
077:            }
078:
079:            // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
080:            /**
081:             * Handles the HTTP <code>GET</code> method.
082:             * 
083:             * @param request servlet request
084:             * @param response servlet response
085:             */
086:            protected void doGet(HttpServletRequest request,
087:                    HttpServletResponse response) throws ServletException,
088:                    IOException {
089:                processRequest(request, response);
090:            }
091:
092:            /**
093:             * Handles the HTTP <code>POST</code> method.
094:             * 
095:             * @param request servlet request
096:             * @param response servlet response
097:             */
098:            protected void doPost(HttpServletRequest request,
099:                    HttpServletResponse response) throws ServletException,
100:                    IOException {
101:                processRequest(request, response);
102:            }
103:
104:            /**
105:             * Returns a short description of the servlet.
106:             */
107:            public String getServletInfo() {
108:                return "ItsNat Servlet";
109:            }
110:            // </editor-fold>    
111:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.