Source Code Cross Referenced for Filter.java in  » Sevlet-Container » apache-tomcat-6.0.14 » javax » servlet » 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 » Sevlet Container » apache tomcat 6.0.14 » javax.servlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * Licensed to the Apache Software Foundation (ASF) under one or more
03:         * contributor license agreements.  See the NOTICE file distributed with
04:         * this work for additional information regarding copyright ownership.
05:         * The ASF licenses this file to You under the Apache License, Version 2.0
06:         * (the "License"); you may not use this file except in compliance with
07:         * the License.  You may obtain a copy of the License at
08:         *
09:         *     http://www.apache.org/licenses/LICENSE-2.0
10:         *
11:         * Unless required by applicable law or agreed to in writing, software
12:         * distributed under the License is distributed on an "AS IS" BASIS,
13:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14:         * See the License for the specific language governing permissions and
15:         * limitations under the License.
16:         */
17:        package javax.servlet;
18:
19:        import java.io.IOException;
20:
21:        /** 
22:         * A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both.
23:         * <br><br>
24:         * Filters perform filtering in the <code>doFilter</code> method. Every Filter has access to 
25:         ** a FilterConfig object from which it can obtain its initialization parameters, a
26:         ** reference to the ServletContext which it can use, for example, to load resources
27:         ** needed for filtering tasks.
28:         ** <p>
29:         ** Filters are configured in the deployment descriptor of a web application
30:         ** <p>
31:         ** Examples that have been identified for this design are<br>
32:         ** 1) Authentication Filters <br>
33:         ** 2) Logging and Auditing Filters <br>
34:         ** 3) Image conversion Filters <br>
35:         ** 4) Data compression Filters <br>
36:         ** 5) Encryption Filters <br>
37:         ** 6) Tokenizing Filters <br>
38:         ** 7) Filters that trigger resource access events <br>
39:         ** 8) XSL/T filters <br>
40:         ** 9) Mime-type chain Filter <br>
41:         * @since	Servlet 2.3
42:         */
43:
44:        public interface Filter {
45:
46:            /** 
47:             * Called by the web container to indicate to a filter that it is being placed into
48:             * service. The servlet container calls the init method exactly once after instantiating the
49:             * filter. The init method must complete successfully before the filter is asked to do any
50:             * filtering work. <br><br>
51:
52:             * The web container cannot place the filter into service if the init method either<br>
53:             * 1.Throws a ServletException <br>
54:             * 2.Does not return within a time period defined by the web container 
55:             */
56:            public void init(FilterConfig filterConfig) throws ServletException;
57:
58:            /**
59:             * The <code>doFilter</code> method of the Filter is called by the container
60:             * each time a request/response pair is passed through the chain due
61:             * to a client request for a resource at the end of the chain. The FilterChain passed in to this
62:             * method allows the Filter to pass on the request and response to the next entity in the
63:             * chain.<p>
64:             * A typical implementation of this method would follow the following pattern:- <br>
65:             * 1. Examine the request<br>
66:             * 2. Optionally wrap the request object with a custom implementation to
67:             * filter content or headers for input filtering <br>
68:             * 3. Optionally wrap the response object with a custom implementation to
69:             * filter content or headers for output filtering <br>
70:             * 4. a) <strong>Either</strong> invoke the next entity in the chain using the FilterChain object (<code>chain.doFilter()</code>), <br>   
71:             ** 4. b) <strong>or</strong> not pass on the request/response pair to the next entity in the filter chain to block the request processing<br>
72:             ** 5. Directly set headers on the response after invocation of the next entity in the filter chain.
73:             **/
74:            public void doFilter(ServletRequest request,
75:                    ServletResponse response, FilterChain chain)
76:                    throws IOException, ServletException;
77:
78:            /**
79:             * Called by the web container to indicate to a filter that it is being taken out of service. This 
80:             * method is only called once all threads within the filter's doFilter method have exited or after
81:             * a timeout period has passed. After the web container calls this method, it will not call the
82:             * doFilter method again on this instance of the filter. <br><br>
83:             * 
84:             * This method gives the filter an opportunity to clean up any resources that are being held (for
85:             * example, memory, file handles, threads) and make sure that any persistent state is synchronized
86:             * with the filter's current state in memory.
87:             */
88:
89:            public void destroy();
90:
91:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.