
JAX-RS
gmemai
这个作者很懒,什么都没留下…
展开
-
JAX-RS @QueryParam example
In JAX-RS, you can use @QueryParam annotation to inject URI query parameter into Java method. for example,/users/query?url=mkyong.comIn above URI pattern, query parameter is “url=mkyong.com“, and you c转载 2015-08-27 11:03:26 · 585 阅读 · 0 评论 -
JAX-RS @FormParam example
In JAX-RS, you can use @FormParam annotation to bind HTML form parameters value to a Java method. The following example show you how to do it :1. HTML FormSee a simple HTML form with “post” method.<htm转载 2015-08-27 11:08:30 · 1217 阅读 · 0 评论 -
Get HTTP header in JAX-RS
In this tutorial, we show you two ways to get HTTP request header in JAX-RS :Inject directly with @HeaderParamPragmatically via @Context1. @HeaderParam ExampleIn this example, it gets the browser “u转载 2015-08-27 11:16:23 · 867 阅读 · 0 评论 -
Download text file from JAX-RS
In JAX-RS, for user to download a file, annotate the method with @Produces(“text/plain”) :Put @Produces(“text/plain”) on service method, with a Response return type. It means the output is a text file.转载 2015-08-27 11:41:18 · 416 阅读 · 0 评论 -
Download image file from JAX-RS
In JAX-RS, for user to download an image file, annotate the method with @Produces("image/image-type") :Put @Produces(“image/png”) on service method, for “png” image.Set “Content-Disposition” in Respo转载 2015-08-27 11:44:13 · 536 阅读 · 0 评论 -
Download pdf file from JAX-RS
In JAX-RS, for pdf file, annotate the method with @Produces("application/pdf") :Put @Produces(“application/pdf”) on service method.Set “Content-Disposition” in Response header to prompt a download bo转载 2015-08-27 11:46:23 · 588 阅读 · 0 评论