forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
ServiceStack Handler Resolution
Prasanna V L edited this page Jul 24, 2013
·
4 revisions
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?
- What is a message based web service?
- Advantages of message based web services
- Why remote services should use separate DTOs
- Getting Started
- Reference
- Clients
- Formats
- View Engines 4. Razor & Markdown Razor
- Hosts
- Advanced
- Configuration options
- Access HTTP specific features in services
- Logging
- Serialization/deserialization
- Request/response filters
- Filter attributes
- Concurrency Model
- Built-in caching options
- Built-in profiling
- Messaging and Redis
- Form Hijacking Prevention
- Auto-Mapping
- HTTP Utils
- Virtual File System
- Config API
- Physical Project Structure
- Modularizing Services
- Plugins
- Tests
- Other Languages
- Use Cases
- Performance
- How To
- Future