
templates.plugins.spincast-routing.spincast-routing.html Maven / Gradle / Ivy
Show all versions of spincast-website Show documentation
{% extends "../../layout.html" %}
{% block sectionClasses %}plugins hasBreadCrumb plugins-spincast-routing{% endblock %}
{% block meta_title %}Plugins - Spincast Routing{% endblock %}
{% block meta_description %}Routing related components.{% endblock %}
{% block scripts %}
{% endblock %}
{% block body %}
Overview
This plugin provides the default implementation
of the Router interface,
a set of classes to help creating Routes and manipulating them and
is one of the most important components of a Spincast application.
Make sure you read the section dedicated to Routing for more information.
Installation
If you use the spincast-default
artifact and the standard Bootstrapper,
this plugin is already installed by default so you have nothing to do!
If you start from scratch, using the spincast-core
artifact, you can use the
plugin by :
1. Adding this Maven artifact to your project:
<dependency>
<groupId>org.spincast</groupId>
<artifactId>spincast-plugins-routing</artifactId>
<version>{{spincast.spincastCurrrentVersion}}</version>
</dependency>
2. Installing the provided SpincastRoutingPluginModule
module to your Guice context.
Plugin class
The class implementing the SpincastPlugin
interface is SpincastRoutingPlugin.
Suggested add-on
-
Name :
routing()
-
Component : RoutingRequestContextAddon
-
Usage : to give your
Route Handlers
access to information about the current
routing process.
Example :
public void myRouteHandler(DefaultRequestContext context) {
// Is the current Route a "Not found" one?
boolean isNotFoundRoute = context.routing().isNotFoundRoute();
//...
}
This add-on is already installed by default on the
Request Context type.
Javadoc
Configuration
You can bind a SpincastRouterConfig
implementation to tweak the default configurations
used by the components this plugin provides. By default, the
SpincastRouterConfigDefault
class is used as the implementation.
{% endblock %}