[英]How to access http://localhost:8080/pdf/abc123.pdf tomcat eclipse
I my code I am trying to access the file abc123.pdf like http://localhost:8080/pdf/abc123.pdf . 我的代码我试图访问文件abc123.pdf,例如http:// localhost:8080 / pdf / abc123.pdf 。 I have set up the the project in eclipse and takes the control of tomcat installation .My project is present under C:\\apache-tomcat-6.0.45\\wtpwebapps\\ . 我已经在eclipse中设置了项目并控制了tomcat的安装。我的项目位于C:\\ apache-tomcat-6.0.45 \\ wtpwebapps \\下。 How can access the file abc123.pdf where shall i keep it so that it can be accessed by http://localhost:8080/pdf/abc123.pdf 如何访问文件abc123.pdf,我应将其保存在哪里,以便可以通过http:// localhost:8080 / pdf / abc123.pdf进行访问
You can deploy the webapp as root webapp, see: deploy webapp from Eclipse to Tomcat root context 您可以将webapp部署为根webapp,请参阅: 将Webapp从Eclipse部署到Tomcat根上下文
Resources that should be accessable directly have to be in the web
-folder of your project. 应直接访问的资源必须位于项目的web
夹中。 Something like this: 像这样:
C:\[PATH_TO_WORKSPACE]\[WEBAPPNAME]\web\pdf\abc123.pdf
After deployment it should be here: 部署后,它应该在这里:
C:\apache-tomcat-6.0.45\wtpwebapps\[WEBAPPNAME]\pdf\abc123.pdf
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.