I am using Jersey 2.9 and I have created a filter which will take an encrypted header value, and decipher it and then pass it along to the endpoint which was called on. I have no idea of how to do this, and I have been searching on the internet but not really found a concrete example of what I want to do. The filter is called, I just have issues passing a value from it to the endpoint.
Could you guys help me!
Here is some sample code:
public class MyFilter implements ContainerRequestFilter
{
@Override
public void filter(ContainerRequestContext requestContext) throws WebApplicationException {
String EncryptedString = requestContext.getHeaderString("Authentication");
/* Doing some methods to remove encryption */
/* Get a string which I want to pass to the endpoint which was called on, in this example: localhost:4883/rest/test */
}
}
@Path("rest")
public class restTest
{
@Path("test")
@GET
@Produces(MediaType.APPLICATION_JSON)
public String Testing(){
/* Process the value from the MyFilter */
}
}