简体   繁体   English

如何在webapp中查看我的index.html文件,该文件是从url上的swagger ui克隆的

[英]how to view my index.html file inside webapp which is cloned from swagger ui on a url

maven-3.0.5 Maven的3.0.5

I want to access the swagger sample application on a browser. 我想在浏览器上访问swagger示例应用程序。 I'm following the instructions of sample swagger-core using this link( https://github.com/wordnik/swagger-core/tree/master/samples/java-jaxrs ). 我正在使用此链接( https://github.com/wordnik/swagger-core/tree/master/samples/java-jaxrs )遵循样本swagger-core的说明。

I have cloned the swagger ui from this link( https://github.com/wordnik/swagger-ui ) and placed under the webapp folder. 我已经从这个链接克隆了swagger ui( https://github.com/wordnik/swagger-ui )并放在webapp文件夹下。

How can i view my index.html file inside a web-app folder which is cloned from swagger-ui on a url? 如何查看我在web-app文件夹中的index.html文件,该文件夹是从url上的swagger-ui克隆的?

Whenever I try to access a url it displays: 每当我尝试访问网址时,它会显示:

This XML file does not appear to have any style information associated with it. 此XML文件似乎没有与之关联的任何样式信息。 The document tree is shown below. 文档树如下所示。

<apiResponse>
  <message>  
     null for url: http://<host>:8002/api/api-docs
  </message>
  <type>
     unknown
  </type>
</apiResponse>

I can't access the swagger-ui. 我无法访问swagger-ui。 Please help me to do that. 请帮我这样做。

Is the index.html file loaded by your browser? index.html文件是否由您的浏览器加载? If so, it seems to me like your api endpoint is not configured correctly. 如果是这样,在我看来,您的api端点配置不正确。

Your /api-docs url should give something back like 你的/ api-docs url应该回馈一下

{"apiVersion":"1.0.0","swaggerVersion":"1.2"}

If that happens, you just have to enter this url into your index.html search field... 如果发生这种情况,您只需在index.html搜索字段中输入此网址即可...

step 1 go to this link https://github.com/wordnik/swagger-ui/archive/master.zip step 2 extract files to any location in your pc step 3 open swagger-ui-master/dist/index.html 步骤1转到此链接https://github.com/wordnik/swagger-ui/archive/master.zip步骤2将文件解压缩到您的电脑中的任何位置步骤3打开swagger-ui-master / dist / index.html

it will open as a file in browser , or you can put it in www directory of your apcahe server and can access using localhost/swagger-ui-master/dist/index.html (depends on your webserver configuration) , 它将在浏览器中作为文件打开,或者您可以将其放在apcahe服务器的www目录中,并可以使用localhost / swagger-ui-master / dist / index.html访问(取决于您的Web服务器配置),

i just followed above steps and works like a charm , 我只是按照上面的步骤,像一个魅力,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 swagger-UI 中的 index.html 中设置 url - How to set url in index.html in swagger-UI 如何从我的index.html文件调用jsp页面? - how to invoke jsp page from my index.html file? Swagger UI在index.html页面上不显示任何内容 - Swagger UI Not Displaying Any Content On index.html Page 如何在“swagger-ui/index.html”中显示手动生成的 OAS - How to display a manually generated OAS in "swagger-ui/index.html" Spring springdoc-openapi:swagger-ui/index.html 找不到状态=404 - Spring springdoc-openapi : swagger-ui/index.html cannot be found status=404 获取,java.lang.IllegalArgumentException:访问swagger-ui时,路径index.html不能以“ /”字符开头 - Get, java.lang.IllegalArgumentException: Path index.html does not start with a “/” character, when accessing swagger-ui Spring引导在webapp文件夹下找不到index.html - Spring boot cannot find index.html under webapp folder 在根目录下部署Web应用-index.html不显示 - Deploying a webapp under ROOT - index.html not displaying Wildfly Swarm RESTeasy隐藏了webapp / index.html - Wildfly Swarm RESTeasy hides webapp/index.html 如何将 Java jsp Arrays 设置到我的 Index.html 表 - How to Set Java jsp Arrays to my Index.html Table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM