1

I am wondering, if it's possible to use Spring Web MVC with Jersey annotations, as I'm having a massive problem with Spring not being able to parse part variables the way Jersey can and I need to migrate some Jersey code to Spring MVC.

I have the following code in Jersey:

@PUT
@Path("{storageId}/{repositoryId}/{path:.*}")
@PreAuthorize("hasAuthority('ARTIFACTS_DEPLOY')")
public Response upload(@PathParam("storageId") String storageId,
                       @PathParam("repositoryId") String repositoryId,
                       @PathParam("path") String path,
                       InputStream is)
{
    ...
}

I would like to convert this over to Spring MVC, but, like I've explained in this SO post, I'm experiencing issues with parsing the path variables.

Hence, my wondering (and a separate question): is it possible to use the same Jersey annotations with Spring MVC?

Community
  • 1
  • 1
carlspring
  • 31,231
  • 29
  • 115
  • 197
  • @PritamBanerjee: This is an example of how to connect Jersey with Spring. I already know how to do that. – carlspring Oct 17 '16 at 20:47
  • Annotations are just that: annotations. They don't do anything. Even if Spring did support JAX-RS annotations (which it doesn't), it would still have to parse their value. – JB Nizet Oct 17 '16 at 20:50

1 Answers1

-2

it's possible to use Spring Web MVC with Jersey annotations, try make a little sample in Spring Initializer there you can check the option jersey, see how spring build this project and try in yours