Invitation to Authors

Interested in writing a book for us?


Please fill this form and get a chance to get published plus $200 bonus online coupon.


PayPal Logo
RESTful JAVA Web Services Interview Questions You\'ll Most Likely
RESTful JAVA Web Services Interview Questions You'll Most Likely

ISBN: 9781466045453

Price:   $19.95
Sale: $15.76

Quantity :        
Book Description:

RESTful JAVA Web Services Interview Questions You'll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver's seat and helps them steer their way to impress the interviewer.

 

 

Table of Contents
1. RESTful Basics / Annotations
2. Deploying a RESTful Web Service
3. Request Parameters
4. Responses
5. Sub-Resources
6. Building URIs
7. Exceptions as Responses
8. Life Cycle
9. Injection
10. Params Extraction
11. Jersey
12. JSON
13. Links
14. JAX-RS client - Jersey Client API
15. HR Questions
16. INDEX
 
 

Includes:

 

a) 203 RESTful JAVA Web Services Interview Questions, Answers and Proven Strategies for getting hired as an IT professional

b) Dozens of examples to respond to interview questions

c) 51 HR Questions with Answers and Proven strategies to give specific, impressive, answers that help nail the interviews

d) 2 Aptitude Tests download available on www.vibrantpublishers.com

 

 

Sample from the book
(Below Questions and Answers are randomly taken from different pages of the book)
 

37: Can RESTful Web Services support multiple types of response (MIME) formats?

Answer:

RESTful Web Services, by confirming to HTTP, does support multiple types of response (MIME) formats e.g. XML, JSON, PLAIN etc

 

40: What does HATEOAS mean?

Answer:

Hypermedia As The Engine Of Application State (HATEOAS) means that state of the exchange in a session is neither kept by the client nor server. All the necessary information is stored in the exchanged HTTP messages

 

47: How will you declare JAX-RS application details in web.xml?

Answer:
As per JAX-RS 1.1 specifications, a fully qualified name of the class implementing Application has to be declared in the <servlet-name> element of the JAX-RS application's web.xml.
This is supported in a Web container implementing Servlet 3.0.

<web-app>
<servlet>
<servlet-name>org.test.rest.MyApplication</servlet-name>
</servlet>
...
<servlet-mapping>
<servlet-name>org.test.rest.MyApplication</servlet-name>
<url-pattern>/resources</url-pattern>
</servlet-mapping>
...
</web-app>
<servlet-class>
element is not required in the servlet declaration.

 

53: How to declare default value of resource method parameter?

Answer:
@Default annotation is used to declare default value of resource method parameter.

@Path("/test")
@GET
public Response getName(@DefaultValue("1") @QueryParam("id") int id){
...
}

 

56: Review the following resource method. If query parameter is not present in the request, what will be the value of resource method parameter 'id'?
@Path("/test")
@GET
public Response getName(@QueryParam("id") int id){
...
}

Answer:
JAVA primitive types get JAVA-defined default values if not present in the query parameter. In the given scenario, id will be 0.

 

Questions 86, 87, 88 are based on the following code snippet

 

@Path("/myResource")
@Produces("text/plain")
public class AResource {

@GET
public String doGetAsPlainText() {
...
}

@GET
@Produces("text/html")
public String doGetAsHtml() {
...
}
}

 

86: Which MIME type can be produced by doGetAsPlainText()?

Answer:
doGetAsPlainText() can produce text/plain which is defined at class level.

 

87: doGetAsHtml() declares that it produces text/html where as the class is declaring that it produces text/plain. Does this mean that doGetAsHtml() produces text/plains and text/html?

Answer:
No. doGetAsHtml() is overriding the class defined MIME type and is producing only text/plain.

 

88: If AResource is capable of producing more than one MIME media type, how will the resource method be chosen?

Answer:
The most acceptable media type declared by the client is the accept header, defines which resource method will be chosen and executed.

 

140: Give an example of JAXB Bean that could be used with JAXB JSON approach.

Answer:
JAXB bean for JSON is simply a JAVA Bean annotated with JAXB annotations. e.g.

@XmlRootElement
public class TestBean {
public String name;
public int id;
public TestBean() {}
public TestBean(String name, int id) {
this.name = name;
this.id = id;
}
}

 

141: How can you produce JSON from a resource method?

Answer:
A resource method can be annotated with @Produces ("application/json") in order to produce application / JSON response.
@GET
@Produces("application/json")
public MyTestBean getMyBean() {
return new TestBean("abc", 1);
}

Where TestBean is a JAXB annoted bean class.

 

Share

New Title Idea Submission

Got a fantastic New Title Idea but didn't find it in our catalogue?


Please fill this form and see your idea getting published. Also a chance to win $100 coupon.



Visitor Rating : 10/ 10 Based on 590 ratings.