aerogear-controller 1.0.0.M1

org.jboss.aerogear.controller.util
Class RequestUtils

java.lang.Object
  extended by org.jboss.aerogear.controller.util.RequestUtils

public class RequestUtils
extends Object

Utility methods for various HttpServletRequest operation.


Constructor Summary
private RequestUtils()
           
 
Method Summary
static Set<String> extractAcceptHeader(javax.servlet.http.HttpServletRequest request)
          Returns the Accept header from the passed-in HttpServletRequest.
static RequestMethod extractMethod(javax.servlet.http.HttpServletRequest httpServletRequest)
          Returns the RequestMethod for the passed-in HttpServletRequest.
static String extractPath(javax.servlet.http.HttpServletRequest request)
          Returns the path of the current request with out the context path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestUtils

private RequestUtils()
Method Detail

extractPath

public static String extractPath(javax.servlet.http.HttpServletRequest request)
Returns the path of the current request with out the context path.

For example, if the web application was deployed with a context path of '/myapp', and the request submitted was '/myapp/cars/12', this method would return '/cars/12'.

Parameters:
request - the HttpServletRequest.
Returns:
String the request path without the context path (suffix)

extractMethod

public static RequestMethod extractMethod(javax.servlet.http.HttpServletRequest httpServletRequest)
Returns the RequestMethod for the passed-in HttpServletRequest.

Parameters:
httpServletRequest - the HttpServletRequest
Returns:
RequestMethod matching the Http Method of the request.

extractAcceptHeader

public static Set<String> extractAcceptHeader(javax.servlet.http.HttpServletRequest request)
Returns the Accept header from the passed-in HttpServletRequest.

Parameters:
request - the HttpServletRequest
Returns:
Set<String> of the values of the Http Accept Header, or an empty list if there was not Accept header

aerogear-controller 1.0.0.M1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.