Java Doc for FilterDispatcher.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » dispatcher » 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 » webwork 2.2.6 » com.opensymphony.webwork.dispatcher 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.opensymphony.webwork.dispatcher.FilterDispatcher

All known Subclasses:   com.opensymphony.webwork.pico.PicoFilterDispatcher,  com.opensymphony.webwork.dispatcher.FilterDispatcherCompatWeblogic61,
FilterDispatcher
public class FilterDispatcher implements Filter,WebWorkStatics(Code)
Master filter for WebWork that handles four distinct responsibilities:
  • Executing actions
  • Cleaning up the ActionContext (see note)
  • Serving static content
  • Kicking off XWork's IoC for the request lifecycle

IMPORTANT: this filter must be mapped to all requests. Unless you know exactly what you are doing, always map to this URL pattern: /*

Executing actions

This filter executes actions by consulting the ActionMapper and determining if the requested URL should invoke an action. If the mapper indicates it should, the rest of the filter chain is stopped and the action is invoked. This is important, as it means that filters like the SiteMesh filter must be placed before this filter or they will not be able to decorate the output of actions.

Cleaning up the ActionContext

This filter will also automatically clean up the ActionContext for you, ensuring that no memory leaks take place. However, this can sometimes cause problems integrating with other products like SiteMesh. See ActionContextCleanUp for more information on how to deal with this.

Serving static content

This filter also serves common static content needed when using various parts of WebWork, such as JavaScript files, CSS files, etc. It works by looking for requests to /webwork/*, and then mapping the value after "/webwork/" to common packages in WebWork and, optionally, in your class path. By default, the following packages are automatically searched:

  • com.opensymphony.webwork.static
  • template

This means that you can simply request /webwork/xhtml/styles.css and the XHTML UI theme's default stylesheet will be returned. Likewise, many of the AJAX UI components require various JavaScript files, which are found in the com.opensymphony.webwork.static package. If you wish to add additional packages to be searched, you can add a comma separated (space, tab and new line will do as well) list in the filter init parameter named "packages". Be careful, however, to expose any packages that may have sensitive information, such as properties file with database access credentials.

Kicking off XWork's IoC for the request lifecycle

This filter also kicks off the XWork IoC request scope, provided that you are using XWork's IoC. All you have to do to get started with XWork's IoC is add a components.xml file to WEB-INF/classes and properly set up the com.opensymphony.webwork.lifecycle.LifecycleListener in web.xml. See the IoC docs for more information.


author:
   Patrick Lightbody
author:
   tm_jee
See Also:   com.opensymphony.webwork.lifecycle.LifecycleListener
See Also:   ActionMapper
See Also:   ActionContextCleanUp
since:
   2.2



Field Summary
protected  FilterConfigfilterConfig
    
protected  String[]pathPrefixes
    


Method Summary
protected  voidafterActionInvocation(HttpServletRequest request, Object o, Object o1)
    
protected  ObjectbeforeActionInvocation(HttpServletRequest request, ServletContext servletContext)
    
protected  booleancheckUrl(URL url, String rawResourcePath)
     handle ..
protected  voidcopy(InputStream input, OutputStream output)
    
protected  DefaultComponentManagercreateComponentManager()
     Returns a new DefaultComponentManager instance.
public  voiddestroy()
    
public  voiddoFilter(ServletRequest req, ServletResponse res, FilterChain chain)
    
protected  InputStreamfindInputStream(String name, String packagePrefix)
    
protected  voidfindStaticResource(String name, HttpServletResponse response)
    
public  FilterConfiggetFilterConfig()
    
protected  ServletContextgetServletContext(HttpSession session)
     Servlet 2.3 specifies that the servlet context can be retrieved from the session.
public  voidinit(FilterConfig filterConfig)
    
protected  String[]parse(String packages)
    
protected  voidsetupContainer(HttpServletRequest request)
    

Field Detail
filterConfig
protected FilterConfig filterConfig(Code)



pathPrefixes
protected String[] pathPrefixes(Code)





Method Detail
afterActionInvocation
protected void afterActionInvocation(HttpServletRequest request, Object o, Object o1)(Code)



beforeActionInvocation
protected Object beforeActionInvocation(HttpServletRequest request, ServletContext servletContext)(Code)



checkUrl
protected boolean checkUrl(URL url, String rawResourcePath)(Code)
handle .. chars here and other URL hacks



copy
protected void copy(InputStream input, OutputStream output) throws IOException(Code)



createComponentManager
protected DefaultComponentManager createComponentManager()(Code)
Returns a new DefaultComponentManager instance. This method is useful for developers wishing to subclass this class and provide a different implementation of DefaultComponentManager. a new DefaultComponentManager instance.



destroy
public void destroy()(Code)



doFilter
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException(Code)



findInputStream
protected InputStream findInputStream(String name, String packagePrefix) throws IOException(Code)



findStaticResource
protected void findStaticResource(String name, HttpServletResponse response) throws IOException(Code)



getFilterConfig
public FilterConfig getFilterConfig()(Code)



getServletContext
protected ServletContext getServletContext(HttpSession session)(Code)
Servlet 2.3 specifies that the servlet context can be retrieved from the session. Unfortunately, some versions of WebLogic can only retrieve the servlet context from the filter config. Hence, this method enables subclasses to retrieve the servlet context from other sources.
Parameters:
  session - the HTTP session where, in Servlet 2.3, the servlet context can be retrieved the servlet context.



init
public void init(FilterConfig filterConfig) throws ServletException(Code)



parse
protected String[] parse(String packages)(Code)



setupContainer
protected void setupContainer(HttpServletRequest request)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.