• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Whats the use of javax.ws.rs.core.Application class

 
Ranch Hand
Posts: 391
1
MySQL Database PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see JAX-RS code where class extends Application. Whats the use of Application class.



Request URL http://localhost:8080/AllMethods/app/root/greet gives hello

But why to use Application class ?

I am using Jersey 1.19
 
Ranch Hand
Posts: 1756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the Application class is used as a starting point for accessing the Restful service.
I am not sure about that.
 
Saloon Keeper
Posts: 2722
354
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Application holds references to the JAX-RS resources, providers, and other configuration-related data. Jersey has ResourceConfig, which is an subclass of Application.

Also, if you are starting a new project, you should probably be looking at Jersey 2.x.
 
Creator of Enthuware JWS+ V6
Posts: 3294
297
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Also, if you are starting a new project, you should probably be looking at Jersey 2.x


However for the OCEWSD6 certification, only JAX-RS 1.x (and Jersey 1.x) is required.
 
Ron McLeod
Saloon Keeper
Posts: 2722
354
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Frits Walraven wrote:However for the OCEWSD6 certification, only JAX-RS 1.x (and Jersey 1.x) is required.


Ahh - I didn't notice that this was in the WS certification forum - thanks.
 
Mahtab Alam
Ranch Hand
Posts: 391
1
MySQL Database PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading the JAX-RS 1.5 docs. Which explains different ways of deploying the JAX-RS services

Thats what docs says



Deployment of your application using web.xml with Servlet 3.0

1 <web-app>
2 <servlet>
3 <servlet-name>Jersey Web Application</servlet-name>
4 <servlet-class>MyApplication</servlet-class>
5 </servlet>
6 ....



So I tried below example , I am using Jersey 1.9 and Tomcat 7









But on requesting the resource class ( http://localhost:8080/DeployingJAX-RS/callMe/message ) I get 404.

What I am missing ?

 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3294
297
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check Jersey Deploying a RESTful Web Service.
 
He's giving us the slip! Quick! Grab this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!