简体   繁体   English

如何从bash调用servlet

[英]How to invoke a servlet from bash

I have java application server (JBoss). 我有Java应用程序服务器(JBoss)。 I deployed servlet which address is: http://localhost:8080/Generate/Pdf . 我部署了servlet,其地址为: http://localhost:8080/Generate/Pdf How can I run it from bash? 如何从bash运行它? How can I pass parameters to run? 如何传递参数以运行?

Use curl : 使用curl

$ curl http://localhost:8080/GeneratePdf

If you want to pass parameters, we must know more about what the servlet accepts. 如果要传递参数,我们必须更多地了解servlet接受什么。

使用curl从命令行执行http请求

或者您可以简单地使用wget

wget http://localhost:8080/GeneratePdf -O path/to/output-file.pdf

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM