• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Oracle REST guide - Packaging the RESTful Web Service Application Using web.xml

 
abraham arellano tavara
Greenhorn
Posts: 9
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I think there are a couple of problems with one example in the Oracle guide for REST services:

The guide is here:
-> http://docs.oracle.com/cd/E24329_01/web.1211/e24983/configure.htm

1.- Error:

If you access to the link above in the example: "Example 3-2 Updating web.xml for Servlet 3.0 If Application Subclass is in Package" there is an error with the "servlet-name" from the "servlet" and "servlet-mapping" definition. As I understand they must be the same.




2.- Error:

In the same example I also don´t understand what means the "param-value" in the "init-param" section. I was expecting the subclass of javax.ws.rs.core.Application which is "MyApplication" ... not a "package name".

Maybe I´m missing something.

Thanks!
 
Himai Minh
Ranch Hand
Posts: 1359
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For question 1, I agree that the < servlet-name> elements should contain MyApplication.

For question 2, I think param-value should be myJaxRSApplication which should extend the javax.ws.rs.Application. I think myJaxRSApplication is a child class of javax.ws.rs.Application in the document.
 
abraham arellano tavara
Greenhorn
Posts: 9
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Himai,

I also would think as you about question #2. However in the section/chapter there is no example class similar to: "myPackage.myJaxRsApplication" that should extend "javax.ws.rs.core.Application".

So I think that would be good idea to advice this issue to them but no idea to whom or how.

Thanks!
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2531
112
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree that example is very sloppy.

There is a Contact Us link at the top of the page, just click on it and report those errors!

If you are studying for the WS-certification, I advice you to read and learn JAX-RS from the Jersey guide, check Jersey 1.18 User Guide
 
Himai Minh
Ranch Hand
Posts: 1359
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also recommend the book called Restful Java with JAX-RS by Bill Burk, published by Orelly.
This book's examples use RestEasy to build Restful applications. Even though it is not directly related to the exam, but its web.xml show you good working examples.
 
Himai Minh
Ranch Hand
Posts: 1359
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abraham,
I found you an example from Bill Burk's Restful Java with JAX-RS, it runs with RestEasy and GlassFish.




The web.xml :

The test:


For more detail, refer to this book and the source code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic