• Email
  • Like
  • Save
  • Private Content
  • Embed
 

RESTful Web services using JAX-RS

by

  • 13,035 views

RESTful Web services using JAX-RS at Java Day, Istanbul, May 2012

RESTful Web services using JAX-RS at Java Day, Istanbul, May 2012

Accessibility

Categories

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

© All Rights Reserved

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

12 Embeds 208

http://glassfish.collected.info 169
http://feeds.feedburner.com 24
http://webcache.googleusercontent.com 3
http://blogs.oracle.com 3
http://feedproxy.google.com 2
http://hero-worshiper6.mymoviepundit.com 1
http://www.directrss.co.il 1
http://translate.googleusercontent.com 1
http://127.0.0.1:8795 1
http://www.hanrss.com 1
http://de.flavors.me 1
http://www.linkedin.com 1

More...

Statistics

Likes
5
Downloads
156
Comments
1
Embed Views
208
Views on SlideShare
12,827
Total Views
13,035

11 of 1 previous next

  • GopalKrishna20 Gopal Krishna at I.T - The Official Page Hi Arun, I am working with Jersy to RESTFUL JSON output. is it possible to send custom object as a @Pathparam using get method and i need json as output using RESTFUL. I mean instead of sending all the parameters URI like ----> custom/1/aaa/addr shall we custom/pojo Client Side: class Pojo{ int id=1; String name='aaa'; String addr='addr'; //setter & getters } Main class: public static void main(String... a) { Pojo pojo = new Pojo(); System.out.println(service.path('rest').path('custom/pojo').accept(MediaType.APPLICATION_JSON).get(String.class)); } server side: @Path('/custom') class Custom { @GET @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Path('{pojo}') public Pojo getJsonOutput(@PathParam('pojo') Pojo p) { if(1==p.getId() && 'aaa'.equals(p.getName()) && 'addr'.equals(p.getAddr()) return new Pojo(); else return null; } } class Pojo{ int id=1; String name='aaa'; String addr='addr'; String firstName='aaa'; String lastName='bbb'; String firstAddr='ccc'; String lastAddr='ddd'; String mobnumber='123457896'; //Setters & Getters } 3 months ago
    Are you sure you want to
Post Comment
Edit your comment

RESTful Web services using JAX-RS RESTful Web services using JAX-RS Presentation Transcript