Cleans up page content
Project: http://git-wip-us.apache.org/repos/asf/struts-site/repo Commit: http://git-wip-us.apache.org/repos/asf/struts-site/commit/faa2f637 Tree: http://git-wip-us.apache.org/repos/asf/struts-site/tree/faa2f637 Diff: http://git-wip-us.apache.org/repos/asf/struts-site/diff/faa2f637 Branch: refs/heads/master Commit: faa2f637c43714ac33a4d2889442b6ec61ff6655 Parents: 732e451 Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Wed Aug 23 10:58:27 2017 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Wed Aug 23 10:58:27 2017 +0200 ---------------------------------------------------------------------- source/core-developers/dispatcher.md | 35 ++++--------- source/core-developers/result-configuration.md | 3 ++ source/core-developers/unknown-handlers.md | 57 +++++++-------------- 3 files changed, 30 insertions(+), 65 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts-site/blob/faa2f637/source/core-developers/dispatcher.md ---------------------------------------------------------------------- diff --git a/source/core-developers/dispatcher.md b/source/core-developers/dispatcher.md index 4a1e727..961c789 100644 --- a/source/core-developers/dispatcher.md +++ b/source/core-developers/dispatcher.md @@ -5,32 +5,15 @@ title: Dispatcher # Dispatcher -###Description### +Dispatcher is the main point of control which dispatch request execution to given actions. It is used +by [filters](web-xml.html) / servlet / listener / portlet to set up and run Struts environment. -Dispatcher is the main point of control which dispatch request execution to given actions\. It is used by [filters](web-xml.html) / servlet / listener / portlet to set up and run Struts environment\. +## Error handling -####Error handling#### +When exception occurs (misconfiguration or some internal error), Dispatcher will pass handling to `DispatcherErrorHandler` +which by default uses `HttpServletResponse#sendError` to report error back to client. It will be 404 or 500 by default +(depends on exception type). -When exception occurs (misconfiguration or some internal error), Dispatcher will pass handling to - -~~~~~~~ -DispatcherErrorHandler -~~~~~~~ - which by default uses - -~~~~~~~ -HttpServletResponse#sendError -~~~~~~~ - to report error back to client\. It will be 404 or 500 by default (depends on exception type)\. - -If you need a different type of handling you can implement your own - -~~~~~~~ -DispatcherErrorHandler -~~~~~~~ - and register it with Dispatcher using extension point - -~~~~~~~ -struts.dispatcher.errorHandler -~~~~~~~ -, see _Plugins_ for how to register your own implementation of internal mechanism\. \ No newline at end of file +If you need a different type of handling you can implement your own `DispatcherErrorHandler` and register it with +Dispatcher using extension point `struts.dispatcher.errorHandler`, see [Plugins](../plugins-developer-guide/) for how +to register your own implementation of internal mechanism. http://git-wip-us.apache.org/repos/asf/struts-site/blob/faa2f637/source/core-developers/result-configuration.md ---------------------------------------------------------------------- diff --git a/source/core-developers/result-configuration.md b/source/core-developers/result-configuration.md index 828503c..f06e26a 100644 --- a/source/core-developers/result-configuration.md +++ b/source/core-developers/result-configuration.md @@ -4,7 +4,10 @@ title: Result Configuration --- # Result Configuration +{:.no_toc} +* Will be replaced with the ToC, excluding a header +{:toc} When an `action` class method completes, it returns a String. The value of the String is used to select a result element. An action mapping will often have a set of results representing different possible outcomes. A standard set of result http://git-wip-us.apache.org/repos/asf/struts-site/blob/faa2f637/source/core-developers/unknown-handlers.md ---------------------------------------------------------------------- diff --git a/source/core-developers/unknown-handlers.md b/source/core-developers/unknown-handlers.md index fec6e6c..4e5e57b 100644 --- a/source/core-developers/unknown-handlers.md +++ b/source/core-developers/unknown-handlers.md @@ -5,33 +5,23 @@ title: Unknown Handlers # Unknown Handlers -Unknown Handler stacks are available from Struts 2\.1 on\. +Unknown Handler stacks are available from Struts 2.1 on. -> +## Unknown Handlers -#####Unkown Handlers##### - -Unknown Handlers are classes that implement the - -~~~~~~~ -com.opensymphony.xwork2.UnknownHandler -~~~~~~~ - interface, and are called by the framework, when an unknown action, result, or method are executed\. To define an unknown handler, create a class implementing the mentioned interface, and add a bean definition to your struts\.xml: - - -~~~~~~~ +Unknown Handlers are classes that implement the `com.opensymphony.xwork2.UnknownHandler` interface, and are called +by the framework, when an unknown action, result, or method are executed. To define an unknown handler, create a class +implementing the mentioned interface, and add a bean definition to your struts.xml: +```xml <bean type="com.opensymphony.xwork2.UnknownHandler" name="handler" class="myclasses.SomeUnknownHandler"/> +``` -~~~~~~~ - -#####Stacking Unknown Handlers##### - -Multiple unknown handlers can be defined, using the _unknown\-handler\-stack_ tag: +## Stacking Unknown Handlers +Multiple unknown handlers can be defined, using the _unknown-handler-stack_ tag: -~~~~~~~ - +```xml <bean type="com.opensymphony.xwork2.UnknownHandler" name="handler1" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/> <bean type="com.opensymphony.xwork2.UnknownHandler" name="handler2" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/> @@ -39,25 +29,14 @@ Multiple unknown handlers can be defined, using the _unknown\-handler\-stack_ t <unknown-handler-ref name="handler1" /> <unknown-handler-ref name="handler2" /> </unknown-handler-stack> +``` -~~~~~~~ - -When multiple unknown handlers are stacked like above, they will be called in the specified order, in the same cases when a single unknown handler would be called (when an unknown action, result, or method are executed), until one of them handles the requested action\. - -#####Uknown Handlers Manager##### - -The default class that handles unknown handler stacks is - -~~~~~~~ -com.opensymphony.xwork2.DefaultUnknownHandlerManager -~~~~~~~ -, a custom implementation of this class can be provided by implementing the interface +When multiple unknown handlers are stacked like above, they will be called in the specified order, in the same cases +when a single unknown handler would be called (when an unknown action, result, or method are executed), until one of them +handles the requested action. -~~~~~~~ -com.opensymphony.xwork2.UnknownHandlerManager -~~~~~~~ - and setting the property +## Unknown Handlers Manager -~~~~~~~ -struts.unknownHandlerManager -~~~~~~~ +The default class that handles unknown handler stacks is `com.opensymphony.xwork2.DefaultUnknownHandlerManager`, +a custom implementation of this class can be provided by implementing the interface `com.opensymphony.xwork2.UnknownHandlerManager` +and setting the property `struts.unknownHandlerManager`.