ServiceStack Handler Resolution
This document explains how the handlers are resolved in ServiceStack, the moment the Context is passed on to the ServiceStackHttpHandlerFactory, and all the actions that happen along with it.
The order of execution is as below, and the first one to be match is executed.
- Iterates through the RawHttpHandlers in the order they were added to EndpointConfig.
- If its a root request ("/"):
- Correct requests "/default.aspx" and "/Default.aspx" to "/", as WebDav Server automatically appends them.
- Iterate through CatchAllHandlers for a match, and if no match is found return DefaultHandler. (Note: DefaultHandler is DefaultHttpHandler if its hosted on the root path or running in a Mono environment. If not, it translates to NonRootModeDefaultHttpHandler)
- Check if a file exists with the name DefaultRootFileName mentioned in the EndpointConfig.
- If it doesn't exist, return IndexPageHttpHandler
- If exists, DefaultHttpHandler is invoked to serve the file if its an allowed extension. If not, ForbiddenHttpHandler is invoked.
- Searches the Service Route Collection for the path. If found, RestHandler is invoked.
- If its a file system path, and no matches so far:
- If its a directory, and it exists, but the path does not have the "/" suffix, RedirectHttpHandler invoked with the trailing "/".
- CatchAllHanders are checked for matches.
- If file doesn't exist, NotFoundHttpHandler is invoked.
- If exists, DefaultHttpHandler is invoked to serve the file if its an allowed extension. If not, ForbiddenHttpHandler is invoked.
- CatchAllHanders are checked for matches.
- If FallbackRestPath is configured RestHander is invoked.
- Resolution fails.
TODO: This document is not complete, and is just a rough draft. There are still a few more attempts left in the resolution process.
- Why ServiceStack?
- Important role of DTOs
- What is a message based web service?
- Advantages of message based web services
- Why remote services should use separate DTOs
-
Getting Started
-
Designing APIs
-
Reference
-
Clients
-
Formats
-
View Engines 4. Razor & Markdown Razor
-
Hosts
-
Security
-
Advanced
- Configuration options
- Access HTTP specific features in services
- Logging
- Serialization/deserialization
- Request/response filters
- Filter attributes
- Concurrency Model
- Built-in profiling
- Form Hijacking Prevention
- Auto-Mapping
- HTTP Utils
- Dump Utils
- Virtual File System
- Config API
- Physical Project Structure
- Modularizing Services
- MVC Integration
- ServiceStack Integration
- Embedded Native Desktop Apps
- Auto Batched Requests
- Versioning
- Multitenancy
-
Caching
-
HTTP Caching 1. CacheResponse Attribute 2. Cache Aware Clients
-
Auto Query
-
AutoQuery Data 1. AutoQuery Memory 2. AutoQuery Service 3. AutoQuery DynamoDB
-
Server Events
-
Service Gateway
-
Encrypted Messaging
-
Plugins
-
Tests
-
ServiceStackVS
-
Other Languages
-
Amazon Web Services
-
Deployment
-
Install 3rd Party Products
-
Use Cases
-
Performance
-
Other Products
-
Future