Skip to Content
RESTful Java Web Services - Third Edition
book

RESTful Java Web Services - Third Edition

by Balachandar Bogunuva Mohanram
November 2017
Intermediate to advanced
420 pages
10h 29m
English
Packt Publishing
Content preview from RESTful Java Web Services - Third Edition

Configuring the Swagger definition

After specifying the Swagger provider components, the next step is to configure and initialize the Swagger definition. This is done by configuring the com.wordnik.swagger.jersey.config.JerseyJaxrsConfig servlet in web.xml, as follows:

<servlet> 
    <servlet-name>Jersey2Config</servlet-name> 
    <servlet-class> 
        com.wordnik.swagger.jersey.config.JerseyJaxrsConfig 
    </servlet-class> 
    <init-param> 
        <param-name>api.version</param-name> 
        <param-value>1.0.0</param-value> 
    </init-param> 
    <init-param> 
        <param-name>swagger.api.basepath</param-name> 
        <param-value> 
            http://localhost:8080/hrapp/webresources 
        </param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

Here is a brief overview of the initialization parameters ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services, Second Edition

RESTful Java Web Services, Second Edition

Jobinesh Purushothaman
Java Web Services

Java Web Services

David A Chappell, Tyler Jewell

Publisher Resources

ISBN: 9781788294041Supplemental Content