Get http request request parameter value - java

I am calling Restful web service via ajax call. On this page i have google recaptcha whose parameter passing via get httprequest parameter. In rest service, i am getting http request object via #Context but it's returning null for both parameter.
How to resolve this issue

Related

Change the endpoint method at handle request interceptor

I am working soap service using spring WS , I want the endpoint need to changed at handle request method in endpoint interceptor based on some condition. Is it possible to change endpoint method at handle request method ?

Handling AWS request and sending status code (200 OK) using AWS lambda

I have worked on SpringBoot rest api,
I have to convert below endpoints into AWS lambda function.
1) /service/promotion/ping/{pignId}. get single object of ping
2) /service/promotion/ping. get complete ping details
I have visited on AWS offical website for reference,
I had successfully converted first endpoint
/service/promotion/ping/{pignId}.
into AWS lambda function.
In first endpoint I was knew that {pignId} was coming in request param with type Integer so i have simply used AWS's RequestHandler interface to handler request like
public class CustomRequest implements RequestHandler<Integer, MyResponse> {
In second endpoint there is no request param means (Integer) coming in request, So
1) Which Handler should I used?
2)I want to send response code 200(OK) if endpoint works properly?
Thank you.

POST Method with JAX-RS does not work correctly with postman tool

I have been testing my REST Service with the PostMan tool. It works fine when I am trying to hit the #POST method with content type application/x-www-form-urlencoded and set all the data in body as a x-www-form-urlencoded parameters.
But when I changed my service method so that it can accept form param only and then I tried to hit service through postman on setting all the parameter as from-data in request body. I am getting null value in form param in service.
postman attachment:
Setting form param
Setting Content type
Service Method

spring NonceExpiredException

I am using spring security 3.2.5. When i pass wrong or empty customer request parameter in the request, I get NonceExpiredException and returning me OK response. For other parameters my webservice is fine.
For example
http://localhost:8080/vtap/devices/?customer=&platform=Andriod
In above url customer parameter is empty. I am getting NonceExpiredException and returning empty OK response and request is not hitting webservice method. I am using spring restfull webservice.Instead of OK response I wanted 400 response.
you can always write a Filter for normalizing your URL and response back 400 as you wish to user before Spring Security Filter even get started ~

Pass /oauth/token parameters in body

Hii I have implemented spring-security-oauth2 in my application. Everything is working fine. But the request goes for token is GET and the parameters are added as Url param.
I want to make it Post request and pass param in Request body.
Is there anyway?

Categories

Resources