org.jasig.cas.web.package.html Maven / Gradle / Ivy
In the Servlet API, the WEB-INF/web.xml deployment descriptor maps
various URL values to Java classes. In Spring, the web.xml maps all
URL program requests to a single generic handler. The mapping of
particular URL values to particular classes is then part of the Spring
configuration, specifically in the cas-servlet.xml file:
<!-- Handler Mapping -->
<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/login">loginController</prop>
<prop key="/logout">logoutController</prop>
<prop key="/serviceValidate">serviceValidateController</prop>
<prop key="/validate">legacyValidateController</prop>
<prop key="/proxy">proxyController</prop>
<prop key="/proxyValidate">proxyValidateController</prop>
<prop key="/CentralAuthenticationService">xFireCentralAuthenticationService</prop>
</props>
</bean>
Each named service is then configured as a bean. For example,
the /login processing is defined as
<bean id="loginController" class="org.jasig.cas.web.LoginController" autowire="byType">
<property name="loginTokens" ref="loginTokens" />
<property name="centralAuthenticationService" ref="centralAuthenticationService" />
</bean>
This package then supplies the classes that implement each of
the URL services that are defined as part of the HTTP CAS protocol.
Each such class is what Spring calls a Controller (from the MVC or
Model, View, Controller paradigm). Generically, Controllers extract
information from the HttpRequest object (Cookies, Headers,
Certificates, Query parameters, etc.). In CAS, each Controller then
calls the CAS layer to perform some operation involving tickets. The
successful return object or failure from CAS is then added to a Map
called the Model and is passed to a JSP page or Java class called
the View that writes back a response.