Tomcat, JAX-RS, Jersey, @PathParam: how to pass dots and slashes?

前端 未结 4 1470
我在风中等你
我在风中等你 2020-12-18 21:52

Having a method like this:

@GET @Path(\"/name/{name}\")
@Produces(MediaType.TEXT_PLAIN)
public String getProperty(@PathParam(\"name\") String name) {
                


        
4条回答
  •  佛祖请我去吃肉
    2020-12-18 22:22

    If you using tomcat, and want pass / in pathparam. besides the @Path("/name/{name:.+}") stuff as 'Donal Fellows' said, you should add -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true to your jvm arguments, see also tomcat security-howto.

提交回复
热议问题