IntelliJ Idea: Deploy a simple Java servlet (no JSP) to Tomcat 7

≯℡__Kan透↙ 提交于 2020-01-01 04:31:09

问题


I tried following the tutorial here to deploy a servlet but that only works if you specify a JSP file. The problem is that without the JSP, I don't know what to set the Startup Page in the Tomcat Run/Debug configuration. So any idea what to do?

Thanks!


回答1:


You should define a servlet-mapping in the web.xml like this:

Then add the url-pattern to the server root URL:




回答2:


Set it to your servlet mapping.

IMO opening new browser window every time you start the server is a PITA.



来源:https://stackoverflow.com/questions/9151460/intellij-idea-deploy-a-simple-java-servlet-no-jsp-to-tomcat-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!