Reputation: 399
I have a following jersey class .
@Path("/static1/static2")
public class DoStuff {
@POST
@Path("/static3")
@Consumes(MediaType.APPLICATION_XML)
@Produces("application/xml")
public Response validation(String inputXML){
so my url is localhost/static1/static2/static3
and I get a 200
my goal is to have a URL that is
localhost/static1/{variable}/static2/static3
I tried modifying my class in the following way
@Path("/static1/{variable}/static2")
public class DoStuff {
@POST
@Path("/static3")
@Consumes(MediaType.APPLICATION_XML)
@Produces("application/xml")
public Response validation(String inputXML){
but I keep getting a 404
, what am I doing wrong ?
Upvotes: 0
Views: 277
Reputation: 19002
The problem seems to be with the last path segment static3.{format}
. Try the following:
@Path("/static1/{variable}/static2")
public class DoStuff {
@POST
@Path("/{segment3:static3.*}")
@Consumes(MediaType.APPLICATION_XML)
@Produces("application/xml")
public Response validation(@PathParam("variable") String variable,
@PathParam("segment3") String segment3,
String inputXML) {
...............
}
Upvotes: 1