I’m new with Jersey Rest Framework and I wrote an simple demo to learn this skill. Here is my problem: I tried to reach my helloworld with this URL—
http://localhost:8080/PayInterface/query/helloworld
but didn’t work. Would you please tell me what I did wrong?
I wrote a class:
@Component
//Declaring that all it will handle all requests starting by /TestCaseDto
@Path("query")
public class QueryApi {
@Path("/helloworld")
@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public String test(){
return new String("Hello World!!!");
}
}
and I
I think in here you return string. so you can’t give produce type as xml,Try this