org.jboss.aerogear.controller.router.decorators.cors
Class CorsHandler
java.lang.Object
org.jboss.aerogear.controller.router.decorators.cors.CorsHandler
- All Implemented Interfaces:
- Router
@Decorator
public class CorsHandler
- extends Object
- implements Router
CorsHandler is a CDI decorator that decorates Router adding CORS
support.
- See Also:
Cors,
CorsConfiguration
|
Method Summary |
void |
dispatch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
Dispatches to an appropriate Route. |
private void |
handlePreflight(Cors cors,
javax.servlet.http.HttpServletResponse response)
|
private void |
handleSimpleRequest(Cors cors,
javax.servlet.http.HttpServletResponse response)
|
boolean |
hasRouteFor(javax.servlet.http.HttpServletRequest request)
Determines if this Router has a Route for the passed-in HttpServletRequest. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
delegate
private final Router delegate
corsConfig
private final CorsConfiguration corsConfig
CorsHandler
@Inject
public CorsHandler(@Delegate
Router delegate,
javax.enterprise.inject.Instance<CorsConfiguration> corsConfigInstance)
hasRouteFor
public boolean hasRouteFor(javax.servlet.http.HttpServletRequest request)
- Description copied from interface:
Router
- Determines if this
Router has a Route for the passed-in HttpServletRequest.
- Specified by:
hasRouteFor in interface Router
- Parameters:
request - the HttpServletRequest.
- Returns:
true if this Router has a Route for the HttpServletRequest, otherwise false.
dispatch
public void dispatch(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
throws javax.servlet.ServletException
- Description copied from interface:
Router
- Dispatches to an appropriate
Route.
- Specified by:
dispatch in interface Router
- Parameters:
request - the HttpServletRequest.response - the HttpServletResponsechain - the FilterChain.
- Throws:
javax.servlet.ServletException - if en error occurs while dispatching.
handleSimpleRequest
private void handleSimpleRequest(Cors cors,
javax.servlet.http.HttpServletResponse response)
handlePreflight
private void handlePreflight(Cors cors,
javax.servlet.http.HttpServletResponse response)
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.