Java Code Examples for javax.servlet.http.HttpServletRequest.getMethod()

The following are Jave code examples for showing how to use getMethod() of the javax.servlet.http.HttpServletRequest class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lams   File: BurlapServiceExporter.java   View Source Code Vote up 6 votes
/**
 * Processes the incoming Burlap request and creates a Burlap response.
 */
@Override
public void handleRequest(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {

	if (!"POST".equals(request.getMethod())) {
		throw new HttpRequestMethodNotSupportedException(request.getMethod(),
				new String[] {"POST"}, "BurlapServiceExporter only supports POST requests");
	}

	try {
	  invoke(request.getInputStream(), response.getOutputStream());
	}
	catch (Throwable ex) {
	  throw new NestedServletException("Burlap skeleton invocation failed", ex);
	}
}
 
Example 2
Project: lib-edge   File: BeforeControllerAdvice.java   View Source Code Vote up 6 votes
@Before("init()")
public void filterBeforeHandling(JoinPoint joinPoint) throws Exception {
  log.debug("before handing");
  ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
  HttpServletRequest request = attributes.getRequest();
  Map<String, String> requestInfoMap = new LinkedHashMap<>();
  String clientIpAddr = RequestHelper.getRealIp(request);
  String requestUri = request.getRequestURI();
  String requestMethod = request.getMethod();
  int size = 0;
  requestInfoMap.put(TemplateEnum.MESSAGE_SOURCE, environment.getProperty(ENV_LOG_KAFKA_MESSAGE_SOURCE));
  requestInfoMap.put(TemplateEnum.REMOTE_HOST, clientIpAddr);
  requestInfoMap.put(TemplateEnum.REQUEST_METHOD, requestMethod);
  requestInfoMap.put(TemplateEnum.RESPONSE_BODY_SIZE, String.valueOf(size));
  requestInfoMap.put(TemplateEnum.REQUEST_URI, requestUri);
  requestInfoMap.put(TemplateEnum.SERVICE_NAME, environment.getProperty(ENV_APPLICATION_NAME));
  requestInfo.set(requestInfoMap);
  startTime.set(System.currentTimeMillis());
}
 
Example 3
Project: lib-edge   File: PipeService.java   View Source Code Vote up 6 votes
public Object penetrate(HttpServletRequest request, Method method, Class controllerClass, Map<String, String[]> filterParam) throws GenericException {
  try {
    String requestMethod = request.getMethod();
    log.debug("penetrate request method: {}", requestMethod);
    if ("OPTIONS".equals(requestMethod)) {
      return null;
    }
    String mappingUrl = getMappingUrl(requestMethod, method);
    URL clientUrl = getRequestUri(request, method, controllerClass, mappingUrl, filterParam);
    log.debug("clientUrl:{}", clientUrl);
    return doRequestOkHttp(clientUrl.toURI(), request, controllerClass, method);
  } catch (IOException | URISyntaxException e) {
    e.printStackTrace();
  }
  return null;
}
 
Example 4
Project: UtilsMaven   File: FilterUtils.java   View Source Code Vote up 5 votes
/**
 * 获取一个指定编码后的request,但只对POST和GET请求编码,其他请求则直接返回原始请求
 *
 * @param request 指定原始请求
 * @param charset 指定编码
 * @return 返回已经编码的request
 * @throws UnsupportedEncodingException 若不支持指定编码则抛出此异常
 */
public static HttpServletRequest getEncodingRequest(
        HttpServletRequest request, String charset)
        throws UnsupportedEncodingException {
    String method = request.getMethod();
    if (method.equalsIgnoreCase("post")) {
        return new EncodingPostRequest(request, charset);
    } else if (method.equalsIgnoreCase("get")) {
        return new EncodingGetRequest(request, charset);
    }
    return request;
}
 
Example 5
Project: springuni-particles   File: LoginFilter.java   View Source Code Vote up 5 votes
public Authentication attemptAuthentication(HttpServletRequest request,
    HttpServletResponse response) throws AuthenticationException {

  if (!request.getMethod().equals("POST")) {
    throw new AuthenticationServiceException(
        "Authentication method not supported: " + request.getMethod());
  }

  try {
    LoginRequest loginRequest =
        objectMapper.readValue(request.getInputStream(), LoginRequest.class);

    String username = Optional
        .ofNullable(loginRequest.getUsername())
        .map(String::trim)
        .orElse("");

    String password = Optional
        .ofNullable(loginRequest.getPassword())
        .orElse("");

    request.setAttribute(REMEMBER_ME_ATTRIBUTE, loginRequest.getRememberMe());

    UsernamePasswordAuthenticationToken authRequest =
        new UsernamePasswordAuthenticationToken(username, password);

    return this.getAuthenticationManager().authenticate(authRequest);
  } catch (AuthenticationException ae) {
    throw ae;
  } catch (Exception e) {
    throw new InternalAuthenticationServiceException(e.getMessage(), e);
  }
}
 
Example 6
Project: OftenPorter   File: WMainServlet.java   View Source Code Vote up 5 votes
@Override
protected void service(HttpServletRequest request,
        HttpServletResponse response) throws ServletException, IOException
{
    String method = request.getMethod();
    if (method.equals("GET"))
    {
        doRequest(request, null, response, PortMethod.GET);
    } else if (method.equals("HEAD"))
    {
        doRequest(request, null, response, PortMethod.HEAD);
    } else if (method.equals("POST"))
    {
        doRequest(request, null, response, PortMethod.POST);
    } else if (method.equals("PUT"))
    {
        doRequest(request, null, response, PortMethod.PUT);
    } else if (method.equals("DELETE"))
    {
        doRequest(request, null, response, PortMethod.DELETE);
    } else if (method.equals("OPTIONS"))
    {
        doRequest(request, null, response, PortMethod.OPTIONS);
    } else if (method.equals("TRACE"))
    {
        doRequest(request, null, response, PortMethod.TARCE);
    } else
    {
        super.service(request, response);
    }

}
 
Example 7
Project: Equella   File: LtiConsumerUserStateHook.java   View Source Code Vote up 5 votes
/**
 * The workaround for Moodle and Canvas OAuth.<br>
 * If we have a duplicate, and it came from Moodle, it's worth presuming a
 * different reality applies. Hopefully by version moodle-3 they'll have
 * fixed this. ext_lms for moodle 2.3, 2.4, 2.5 was literally "moodle-2".
 * Use startsWith in case future moodle 2.x has an extended string. Read:
 * Dodgical hax
 * 
 * @param request
 * @return
 */
@Override
protected OAuthMessage getOAuthMessage(HttpServletRequest request)
{
	boolean dupe = false;
	String extlms = request.getParameter(ExternalToolConstants.EXT_LMS);
	String product = request.getParameter(ExternalToolConstants.TOOL_CONSUMER_INFO_PRODUCT_FAMILY_CODE);

	Set<Entry<String, String[]>> params = request.getParameterMap().entrySet();
	Map<String, String> newParams = Maps.newHashMap();

	if( "canvas".equalsIgnoreCase(product)
		|| (extlms != null && extlms.startsWith("moodle-2") && "moodle".equalsIgnoreCase(product))
		//hack for canvas ContentItemPlacements
		|| (request.getParameter("lti_message_type") != null
			&& request.getParameter("lti_message_type").equals("ContentItemSelectionRequest")) )
	{
		for( Entry<String, String[]> p : params )
		{
			String[] values = p.getValue();
			if( values.length == 2 && Objects.equal(values[0], values[1]) )
			{
				dupe = true;
			}
			newParams.put(p.getKey(), values[0]);
		}

		if( dupe )
		{
			return new OAuthMessage(request.getMethod(), urlService.getUriForRequest(request, null).toString(),
				newParams.entrySet());
		}
	}

	return OAuthServlet.getMessage(request, urlService.getUriForRequest(request, null).toString());
}
 
Example 8
Project: jerrydog   File: AuthenticatorBase.java   View Source Code Vote up 5 votes
/**
 * Return the SecurityConstraint configured to guard the request URI for
 * this request, or <code>null</code> if there is no such constraint.
 *
 * @param request Request we are processing
 */
protected SecurityConstraint findConstraint(HttpRequest request) {

    // Are there any defined security constraints?
    SecurityConstraint constraints[] = context.findConstraints();
    if ((constraints == null) || (constraints.length == 0)) {
        if (debug >= 2)
            log("  No applicable constraints defined");
        return (null);
    }

    // Check each defined security constraint
    HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
    String uri = request.getDecodedRequestURI();
    String contextPath = hreq.getContextPath();
    if (contextPath.length() > 0)
        uri = uri.substring(contextPath.length());
    String method = hreq.getMethod();
    for (int i = 0; i < constraints.length; i++) {
        if (debug >= 2)
            log("  Checking constraint '" + constraints[i] +
                "' against " + method + " " + uri + " --> " +
                constraints[i].included(uri, method));
        if (constraints[i].included(uri, method))
            return (constraints[i]);
    }

    // No applicable security constraint was found
    if (debug >= 2)
        log("  No applicable constraint located");
    return (null);

}
 
Example 9
Project: lib-edge   File: BeforeControllerAdvice.java   View Source Code Vote up 5 votes
@Around("init()")
public Object filterAroundHandling(ProceedingJoinPoint joinPoint) throws Throwable {
  log.debug("around handing");
  //action
  MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
  Method action = methodSignature.getMethod();
  //接收到请求,记录请求内容
  ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
  HttpServletRequest request = attributes.getRequest();
  //流控
  String clientIp = request.getRemoteAddr();
  String sessionId = request.getSession().getId();
  String requestUri = request.getRequestURI();
  String requestMethod = request.getMethod();
  long requestTimestamp = System.currentTimeMillis();
  flowControlService.flowController(clientIp, sessionId, requestUri, requestMethod, requestTimestamp, action.getDeclaredAnnotation(FlowControl.class));
  //过滤参数
  Map<String, String[]> filterParam = filterParamService.filterParam(request.getParameterMap(), action.getDeclaredAnnotation(FilterParam.class));
  //触发action, 完成参数校验部分
  Object object = joinPoint.proceed();
  log.debug("local response: {}", object);
  //透传
  PipeConfig pipeConfig = action.getAnnotation(PipeConfig.class);
  if (pipeConfig != null) {
    object = penetrationService.penetrate(request, action, methodSignature.getDeclaringType(), filterParam);
  }
  log.debug("penetration response: {}", object);
  return object;
}
 
Example 10
Project: lams   File: WebdavServlet.java   View Source Code Vote up 5 votes
/**
 * Handles the special WebDAV methods.
 */
protected void service(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {

    String method = req.getMethod();

    if (debug > 0) {
        String path = getRelativePath(req);
        log("[" + method + "] " + path);
    }

    if (method.equals(METHOD_PROPFIND)) {
        doPropfind(req, resp);
    } else if (method.equals(METHOD_PROPPATCH)) {
        doProppatch(req, resp);
    } else if (method.equals(METHOD_MKCOL)) {
        doMkcol(req, resp);
    } else if (method.equals(METHOD_COPY)) {
        doCopy(req, resp);
    } else if (method.equals(METHOD_MOVE)) {
        doMove(req, resp);
    } else if (method.equals(METHOD_LOCK)) {
        doLock(req, resp);
    } else if (method.equals(METHOD_UNLOCK)) {
        doUnlock(req, resp);
    } else {
        // DefaultServlet processing
        super.service(req, resp);
    }

}
 
Example 11
Project: hadoop   File: CheckUploadContentTypeFilter.java   View Source Code Vote up 5 votes
/**
 * Enforces the content-type to be application/octet-stream for
 * POST and PUT requests.
 *
 * @param request servlet request.
 * @param response servlet response.
 * @param chain filter chain.
 *
 * @throws IOException thrown if an IO error occurrs.
 * @throws ServletException thrown if a servet error occurrs.
 */
@Override
public void doFilter(ServletRequest request, ServletResponse response,
                     FilterChain chain)
  throws IOException, ServletException {
  boolean contentTypeOK = true;
  HttpServletRequest httpReq = (HttpServletRequest) request;
  HttpServletResponse httpRes = (HttpServletResponse) response;
  String method = httpReq.getMethod();
  if (method.equals("PUT") || method.equals("POST")) {
    String op = httpReq.getParameter(HttpFSFileSystem.OP_PARAM);
    if (op != null && UPLOAD_OPERATIONS.contains(
        StringUtils.toUpperCase(op))) {
      if ("true".equalsIgnoreCase(httpReq.getParameter(HttpFSParametersProvider.DataParam.NAME))) {
        String contentType = httpReq.getContentType();
        contentTypeOK =
          HttpFSFileSystem.UPLOAD_CONTENT_TYPE.equalsIgnoreCase(contentType);
      }
    }
  }
  if (contentTypeOK) {
    chain.doFilter(httpReq, httpRes);
  }
  else {
    httpRes.sendError(HttpServletResponse.SC_BAD_REQUEST,
                      "Data upload requests must have content-type set to '" +
                      HttpFSFileSystem.UPLOAD_CONTENT_TYPE + "'");

  }
}
 
Example 12
Project: ontology_setting   File: LoggerInterceptor.java   View Source Code Vote up 4 votes
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
		throws Exception {
    //创建日志实体
       LoggerEntity loggerEntity = new LoggerEntity();
       
       //获取请求sessionId
       String sessionId = request.getRequestedSessionId();
       //设置sessionId
       loggerEntity.setSessionId(sessionId);
       
       //设置请求方法
       String method = request.getMethod();
       loggerEntity.setMethod(method);
       
       //设置访问协议
       String protocol = request.getProtocol();
       loggerEntity.setProtocol(protocol);
       
       //请求路径
       String url = request.getRequestURI();
       //设置请求地址
       loggerEntity.setUrl(url);
       
       //获取请求参数信息
       String paramData = JSON.toJSONString(request.getParameterMap(),
               SerializerFeature.DisableCircularReferenceDetect,
               SerializerFeature.WriteMapNullValue);
       //设置请求参数内容json字符串
       loggerEntity.setParamData(paramData);
       
       //设置客户端ip
       loggerEntity.setClientIp(LoggerUtils.getCliectIp(request));
       
       long requestTime = System.currentTimeMillis();
       loggerEntity.setTime(new Timestamp(requestTime));
       
       //设置请求开始时间
       request.setAttribute(LOGGER_SEND_TIME, requestTime);
       request.setAttribute(LOGGER_ENTITY, loggerEntity);
	return true;
}
 
Example 13
Project: OpenLRW   File: XAPIErrorInfo.java   View Source Code Vote up 4 votes
private void getDataFromRequest(final HttpServletRequest request) {
    this.path = request.getRequestURI();
    this.method = request.getMethod();
    this.parameters = request.getParameterMap();
}
 
Example 14
Project: careconnect-reference-implementation   File: ServerInterceptor.java   View Source Code Vote up 4 votes
@Override
public boolean incomingRequestPreProcessed(HttpServletRequest request, HttpServletResponse theResponse) {

    if (request.getMethod() != null) {

        /* KGM 3/1/2018 This is now handled by CORS headers

       if (theRequest.getMethod().equals("OPTIONS"))
            throw new MethodNotAllowedException("request must use HTTP GET");
        */

        if (request.getContentType() != null) {
           checkContentType(request.getContentType());
        }

        if (request.getQueryString() != null) {


            List<NameValuePair> params = null;
            try {
                params = URLEncodedUtils.parse(new URI("http://dummy?" + request.getQueryString()), "UTF-8");
            } catch (Exception ex) {
            }

            ListIterator paramlist = params.listIterator();
            while (paramlist.hasNext()) {
                NameValuePair param = (NameValuePair) paramlist.next();
                if (param.getName().equals("_format"))
                    checkContentType(param.getValue());

            }
        }


        // May need to re-add this at a later date (probably in conjunction with a security uplift)
        /*
        KGM 3/1/2018 disabled for crucible testing

        if (request.getMethod().equals("POST") && request.getPathInfo() != null && request.getPathInfo().contains("_search"))
            throw new MethodNotAllowedException("request must use HTTP GET");
            */
    }
    return true;
}
 
Example 15
Project: apache-tomcat-7.0.73-with-comment   File: WebdavServlet.java   View Source Code Vote up 4 votes
/**
 * Handles the special WebDAV methods.
 */
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {

    final String path = getRelativePath(req);

    // Block access to special subdirectories.
    // DefaultServlet assumes it services resources from the root of the web app
    // and doesn't add any special path protection
    // WebdavServlet remounts the webapp under a new path, so this check is
    // necessary on all methods (including GET).
    if (isSpecialPath(path)) {
        resp.sendError(WebdavStatus.SC_NOT_FOUND);
        return;
    }

    final String method = req.getMethod();

    if (debug > 0) {
        log("[" + method + "] " + path);
    }

    if (method.equals(METHOD_PROPFIND)) {
        doPropfind(req, resp);
    } else if (method.equals(METHOD_PROPPATCH)) {
        doProppatch(req, resp);
    } else if (method.equals(METHOD_MKCOL)) {
        doMkcol(req, resp);
    } else if (method.equals(METHOD_COPY)) {
        doCopy(req, resp);
    } else if (method.equals(METHOD_MOVE)) {
        doMove(req, resp);
    } else if (method.equals(METHOD_LOCK)) {
        doLock(req, resp);
    } else if (method.equals(METHOD_UNLOCK)) {
        doUnlock(req, resp);
    } else {
        // DefaultServlet processing
        super.service(req, resp);
    }

}
 
Example 16
Project: alfresco-remote-api   File: WebDAVServlet.java   View Source Code Vote up 4 votes
/**
 * Create a WebDAV method handler
 * 
 * @param request HttpServletRequest
 * @param response HttpServletResponse
 * @return WebDAVMethod
 */
protected WebDAVMethod createMethod(HttpServletRequest request, HttpServletResponse response)
{
    // Get the type of the current request
    
    String strHttpMethod = request.getMethod();

    if (logger.isDebugEnabled())
        logger.debug("WebDAV request " + strHttpMethod + " on path "
                + request.getRequestURI());

    Class<? extends WebDAVMethod> methodClass = m_davMethods.get(strHttpMethod);
    WebDAVMethod method = null;

    if (methodClass != null)
    {
        try
        {
            // Create the handler method    
            method = methodClass.newInstance();
            method.setDetails(request, response, m_davHelper, getRootNodeRef());
            
            // A very few WebDAV methods produce activity posts.
            if (method instanceof ActivityPostProducer)
            {
                ActivityPostProducer activityPostProducer = (ActivityPostProducer) method;
                activityPostProducer.setActivityPoster(activityPoster);
            }
        }
        catch (Exception ex)
        {
            // Debug
            
            if ( logger.isDebugEnabled())
                logger.debug(ex);
        }
    }

    // Return the WebDAV method handler, or null if not supported
    
    return method;
}
 
Example 17
Project: lazycat   File: CorsFilter.java   View Source Code Vote up 4 votes
/**
 * Handles a CORS request of type {@link CORSRequestType}.SIMPLE.
 *
 * @param request
 *            The {@link HttpServletRequest} object.
 * @param response
 *            The {@link HttpServletResponse} object.
 * @param filterChain
 *            The {@link FilterChain} object.
 * @throws IOException
 * @throws ServletException
 * @see <a href="http://www.w3.org/TR/cors/#resource-requests">Simple
 *      Cross-Origin Request, Actual Request, and Redirects</a>
 */
protected void handleSimpleCORS(final HttpServletRequest request, final HttpServletResponse response,
		final FilterChain filterChain) throws IOException, ServletException {

	CorsFilter.CORSRequestType requestType = checkRequestType(request);
	if (!(requestType == CorsFilter.CORSRequestType.SIMPLE || requestType == CorsFilter.CORSRequestType.ACTUAL)) {
		throw new IllegalArgumentException(sm.getString("corsFilter.wrongType2", CorsFilter.CORSRequestType.SIMPLE,
				CorsFilter.CORSRequestType.ACTUAL));
	}

	final String origin = request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
	final String method = request.getMethod();

	// Section 6.1.2
	if (!isOriginAllowed(origin)) {
		handleInvalidCORS(request, response, filterChain);
		return;
	}

	if (!allowedHttpMethods.contains(method)) {
		handleInvalidCORS(request, response, filterChain);
		return;
	}

	// Section 6.1.3
	// Add a single Access-Control-Allow-Origin header.
	if (anyOriginAllowed && !supportsCredentials) {
		// If resource doesn't support credentials and if any origin is
		// allowed
		// to make CORS request, return header with '*'.
		response.addHeader(CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "*");
	} else {
		// If the resource supports credentials add a single
		// Access-Control-Allow-Origin header, with the value of the Origin
		// header as value.
		response.addHeader(CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, origin);
	}

	// Section 6.1.3
	// If the resource supports credentials, add a single
	// Access-Control-Allow-Credentials header with the case-sensitive
	// string "true" as value.
	if (supportsCredentials) {
		response.addHeader(CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
	}

	// Section 6.1.4
	// If the list of exposed headers is not empty add one or more
	// Access-Control-Expose-Headers headers, with as values the header
	// field names given in the list of exposed headers.
	if ((exposedHeaders != null) && (exposedHeaders.size() > 0)) {
		String exposedHeadersString = join(exposedHeaders, ",");
		response.addHeader(CorsFilter.RESPONSE_HEADER_ACCESS_CONTROL_EXPOSE_HEADERS, exposedHeadersString);
	}

	// Forward the request down the filter chain.
	filterChain.doFilter(request, response);
}
 
Example 18
Project: keti   File: AbstractHttpMethodsFilter.java   View Source Code Vote up 4 votes
@Override
protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response,
        final FilterChain filterChain) throws ServletException, IOException {

    String requestMethod = request.getMethod();

    if (HttpMethod.TRACE.matches(requestMethod)) {
        sendMethodNotAllowedError(response);
        return;
    }

    String requestUri = request.getRequestURI();

    if (!HttpMethod.OPTIONS.matches(requestMethod)) {
        for (Map.Entry<String,
                Set<HttpMethod>> uriPatternsAndAllowedHttpMethodsEntry : this.uriPatternsAndAllowedHttpMethods
                        .entrySet()) {
            if (Pattern.compile(uriPatternsAndAllowedHttpMethodsEntry.getKey()).matcher(requestUri).matches()) {
                if (!uriPatternsAndAllowedHttpMethodsEntry.getValue().contains(HttpMethod.resolve(requestMethod))) {
                    sendMethodNotAllowedError(response);
                    return;
                }

                String acceptHeaderValue = request.getHeader(HttpHeaders.ACCEPT);
                if (acceptHeaderValue != null) {
                    try {
                        List<MimeType> parsedMimeTypes = MimeTypeUtils.parseMimeTypes(acceptHeaderValue);
                        boolean foundAcceptableMimeType = false;
                        for (MimeType parsedMimeType : parsedMimeTypes) {
                            // When checking for acceptable MIME types, strip out the character set
                            if (ACCEPTABLE_MIME_TYPES.contains(
                                    new MimeType(parsedMimeType.getType(), parsedMimeType.getSubtype()))) {
                                foundAcceptableMimeType = true;
                                break;
                            }
                        }
                        if (!foundAcceptableMimeType) {
                            LOGGER_INSTANCE.error("Malformed Accept header sent in request: {}", acceptHeaderValue);
                            sendNotAcceptableError(response);
                            return;
                        }
                    } catch (Exception e) {
                        sendNotAcceptableError(response);
                        return;
                    }
                }

                break;
            }
        }
    }
    filterChain.doFilter(request, response);
}
 
Example 19
Project: lams   File: HttpRequestMessage.java   View Source Code Vote up 4 votes
public HttpRequestMessage(HttpServletRequest request, String URL) {
    super(request.getMethod(), URL, getParameters(request));
    this.request = request;
    copyHeaders(request, getHeaders());
}
 
Example 20
Project: parabuild-ci   File: SampleServlet.java   View Source Code Vote up 2 votes
/**
 * Return the method used to send data from the client (POST or GET). This
 * will be used to verify that we can simulate POST or GET methods from
 * Cactus. This simulates a method which would test the method to
 * implement it's business logic.
 *
 * @param theRequest the HTTP request
 * @return the method used to post data
 */
public String checkMethod(HttpServletRequest theRequest)
{
    return theRequest.getMethod();
}