How do I deploy a JSP file in the Jetty webserver?

2019-07-17 08:40发布

I have created a simple JSP file that I want to deploy in Jetty 7.2. Jetty is running and I can see the default web page at http://localhost:8080/. I started Jetty with the java -jar start.jar command.

I saved my simple JSP file jsp_test.jsp at <my_jetty_directory>/webapps/jsp_test.jsp and then I tried to access that file on http://localhost:8080/jsp_test.jsp and http://localhost:8080/webapps/jsp_test.jsp but none of them works.

Is there something more I have to do? Where in the Jetty file structure should I place my JSP file?

If you know a helpful tutorial I would be thankful. I haven't found any good ones.

1条回答
手持菜刀,她持情操
2楼-- · 2019-07-17 09:15

You have to place it in a folder inside webapps:

webapps/myapp -> http://localhost:8080/myapp/test.jsp

查看更多
登录 后发表回答