Skip to content

springfox-swagger-ui cannot find swagger-resources when run outside of spring boot #983

Description

@jmandawg

Hi,

I'm running in springfox v2.2.2 inside JBoss. My dispatch serverlet looks like this:

          <servlet>
        <servlet-name>RestServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value></param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>RestServlet</servlet-name>
            <url-pattern>/restservices/*</url-pattern>
    </servlet-mapping>

And it works fine, and i can get to the swagger-resources from here:
http://localhost:8080/rootContext/restservices/swagger-resources

And i can view the api from here:
http://localhost:8080/rootContext/restservices/v2/api-docs

And Swagger-UI is accessable from here:
http://localhost:8080/rootContext/swagger-ui.html

The problem is when i load the http://localhost:8080/rootContext/swagger-ui.html page it is trying to access the swagger-resources from here:
http://localhost:8080/rootContext/swagger-resources

And they are not available. How can i fix this so that the swagger-ui.html either:

  1. looks in the right location (http://localhost:8080/rootContext/restservices/swagger-resources)
    or
  2. Swagger-ui.html is available at: http://localhost:8080/rootContext/restservices/swagger-ui.html

Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions