Java Doc for Dispatcher.java in  » Web-Framework » struts-2.0.11 » org » apache » struts2 » 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 » Web Framework » struts 2.0.11 » org.apache.struts2.dispatcher 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.struts2.dispatcher.Dispatcher

Dispatcher
public class Dispatcher (Code)
A utility class the actual dispatcher delegates most of its tasks to. Each instance of the primary dispatcher holds an instance of this dispatcher to be shared for all requests.
See Also:   org.apache.struts2.dispatcher.FilterDispatcher
See Also:   org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher

Inner Class :public class Locator


Constructor Summary
public  Dispatcher(ServletContext servletContext, Map<String, String> initParams)
     Create the Dispatcher instance for a given ServletContext and set of initialization parameters.

Method Summary
public static synchronized  voidaddDispatcherListener(DispatcherListener listener)
     Add a dispatcher lifecycle listener.
public  voidcleanup()
     Releases all instances bound to this dispatcher instance.
public  Map<String, Object>createContextMap(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping, ServletContext context)
    
public  HashMap<String, Object>createContextMap(Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
     Merge all application and servlet attributes into a single HashMap to represent the entire Action context.
Parameters:
  requestMap - a Map of all request attributes.
Parameters:
  parameterMap - a Map of all request parameters.
Parameters:
  sessionMap - a Map of all session attributes.
Parameters:
  applicationMap - a Map of all servlet context attributes.
Parameters:
  request - the HttpServletRequest object.
Parameters:
  response - the HttpServletResponse object.
Parameters:
  servletContext - the ServletContextmapping object.
public  ConfigurationManagergetConfigurationManager()
     Expose the ConfigurationManager instance.
public  ContainergetContainer()
     Expose the dependency injection container.
public static  DispatchergetInstance()
     Provide the dispatcher instance for the current thread.
public  voidinit()
     Load configurations, including both XML and zero-configuration strategies, and update optional settings, including whether to reload configurations and resource files.
public  booleanisPortletSupportActive()
     Return true, if portlet support is active, false otherwise.
public  voidprepare(HttpServletRequest request, HttpServletResponse response)
     Prepare a request, including setting the encoding and locale.
public static synchronized  voidremoveDispatcherListener(DispatcherListener listener)
     Remove a specific dispatcher lifecycle listener.
public  voidsendError(HttpServletRequest request, HttpServletResponse response, ServletContext ctx, int code, Exception e)
     Send an HTTP error response code.
public  voidserviceAction(HttpServletRequest request, HttpServletResponse response, ServletContext context, ActionMapping mapping)
     Load Action class for mapping and invoke the appropriate Action method, or go directly to the Result.
public  voidsetConfigurationManager(ConfigurationManager mgr)
    
public static  voidsetDefaultEncoding(String val)
     Modify state of StrutsConstants.STRUTS_I18N_ENCODING setting.
public static  voidsetDefaultLocale(String val)
     Modify state of StrutsConstants.STRUTS_LOCALE setting.
public static  voidsetDevMode(String mode)
     Modify state of StrutsConstants.STRUTS_DEVMODE setting.
public static  voidsetInstance(Dispatcher instance)
     Store the dispatcher instance for this thread.
public static  voidsetMultipartSaveDir(String val)
     Modify state of StrutsConstants.STRUTS_MULTIPART_SAVEDIR setting.
public static  voidsetPortletSupportActive(boolean portletSupportActive)
     Modify the portlet support mode.
public  HttpServletRequestwrapRequest(HttpServletRequest request, ServletContext servletContext)
     Wrap and return the given request or return the original request object.


Constructor Detail
Dispatcher
public Dispatcher(ServletContext servletContext, Map<String, String> initParams)(Code)
Create the Dispatcher instance for a given ServletContext and set of initialization parameters.
Parameters:
  servletContext - Our servlet context
Parameters:
  initParams - The set of initialization parameters




Method Detail
addDispatcherListener
public static synchronized void addDispatcherListener(DispatcherListener listener)(Code)
Add a dispatcher lifecycle listener.
Parameters:
  listener - The listener to add



cleanup
public void cleanup()(Code)
Releases all instances bound to this dispatcher instance.



createContextMap
public Map<String, Object> createContextMap(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping, ServletContext context)(Code)
Create a context map containing all the wrapped request objects
Parameters:
  request - The servlet request
Parameters:
  response - The servlet response
Parameters:
  mapping - The action mapping
Parameters:
  context - The servlet context A map of context objects



createContextMap
public HashMap<String, Object> createContextMap(Map requestMap, Map parameterMap, Map sessionMap, Map applicationMap, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)(Code)
Merge all application and servlet attributes into a single HashMap to represent the entire Action context.
Parameters:
  requestMap - a Map of all request attributes.
Parameters:
  parameterMap - a Map of all request parameters.
Parameters:
  sessionMap - a Map of all session attributes.
Parameters:
  applicationMap - a Map of all servlet context attributes.
Parameters:
  request - the HttpServletRequest object.
Parameters:
  response - the HttpServletResponse object.
Parameters:
  servletContext - the ServletContextmapping object. a HashMap representing the Action context.



getConfigurationManager
public ConfigurationManager getConfigurationManager()(Code)
Expose the ConfigurationManager instance. The instance



getContainer
public Container getContainer()(Code)
Expose the dependency injection container. Our dependency injection container



getInstance
public static Dispatcher getInstance()(Code)
Provide the dispatcher instance for the current thread. The dispatcher instance



init
public void init()(Code)
Load configurations, including both XML and zero-configuration strategies, and update optional settings, including whether to reload configurations and resource files.



isPortletSupportActive
public boolean isPortletSupportActive()(Code)
Return true, if portlet support is active, false otherwise. true, if portlet support is active, false otherwise.



prepare
public void prepare(HttpServletRequest request, HttpServletResponse response)(Code)
Prepare a request, including setting the encoding and locale.
Parameters:
  request - The request
Parameters:
  response - The response



removeDispatcherListener
public static synchronized void removeDispatcherListener(DispatcherListener listener)(Code)
Remove a specific dispatcher lifecycle listener.
Parameters:
  listener - The listener



sendError
public void sendError(HttpServletRequest request, HttpServletResponse response, ServletContext ctx, int code, Exception e)(Code)
Send an HTTP error response code.
Parameters:
  request - the HttpServletRequest object.
Parameters:
  response - the HttpServletResponse object.
Parameters:
  code - the HttpServletResponse error code (see javax.servlet.http.HttpServletResponse for possible error codes).
Parameters:
  e - the Exception that is reported.
Parameters:
  ctx - the ServletContext object.



serviceAction
public void serviceAction(HttpServletRequest request, HttpServletResponse response, ServletContext context, ActionMapping mapping) throws ServletException(Code)
Load Action class for mapping and invoke the appropriate Action method, or go directly to the Result.

This method first creates the action context from the given parameters, and then loads an ActionProxy from the given action name and namespace. After that, the Action method is executed and output channels through the response object. Actions not found are sent back to the user via the Dispatcher.sendError method, using the 404 return code. All other errors are reported by throwing a ServletException.
Parameters:
  request - the HttpServletRequest object
Parameters:
  response - the HttpServletResponse object
Parameters:
  mapping - the action mapping object
throws:
  ServletException - when an unknown error occurs (not a 404, but typically something thatwould end up as a 5xx by the servlet container)
Parameters:
  context - Our ServletContext object




setConfigurationManager
public void setConfigurationManager(ConfigurationManager mgr)(Code)
Modify the ConfigurationManager instance
Parameters:
  mgr - The configuration manager



setDefaultEncoding
public static void setDefaultEncoding(String val)(Code)
Modify state of StrutsConstants.STRUTS_I18N_ENCODING setting.
Parameters:
  val - New setting



setDefaultLocale
public static void setDefaultLocale(String val)(Code)
Modify state of StrutsConstants.STRUTS_LOCALE setting.
Parameters:
  val - New setting



setDevMode
public static void setDevMode(String mode)(Code)
Modify state of StrutsConstants.STRUTS_DEVMODE setting.
Parameters:
  mode - New setting



setInstance
public static void setInstance(Dispatcher instance)(Code)
Store the dispatcher instance for this thread.
Parameters:
  instance - The instance



setMultipartSaveDir
public static void setMultipartSaveDir(String val)(Code)
Modify state of StrutsConstants.STRUTS_MULTIPART_SAVEDIR setting.
Parameters:
  val - New setting



setPortletSupportActive
public static void setPortletSupportActive(boolean portletSupportActive)(Code)
Modify the portlet support mode.
Parameters:
  portletSupportActive - true or false



wrapRequest
public HttpServletRequest wrapRequest(HttpServletRequest request, ServletContext servletContext) throws IOException(Code)
Wrap and return the given request or return the original request object.

This method transparently handles multipart data as a wrapped class around the given request. Override this method to handle multipart requests in a special way or to handle other types of requests. Note, org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper is flexible - look first to that object before overriding this method to handle multipart data.
Parameters:
  request - the HttpServletRequest object.
Parameters:
  servletContext - Our ServletContext object a wrapped request or original request.
See Also:   org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
throws:
  java.io.IOException - on any error.



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.