IntelliJ Idea:将一个简单的Java servlet(无JSP)部署到Tomcat 7 [英] IntelliJ Idea: Deploy a simple Java servlet (no JSP) to Tomcat 7

查看:400
本文介绍了IntelliJ Idea:将一个简单的Java servlet(无JSP)部署到Tomcat 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按照此处教程来部署servlet,但只有在指定了JSP文件。问题是没有JSP,我不知道在Tomcat运行/调试配置中设置启动页面的内容。所以不知道该怎么做?

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?

谢谢!

推荐答案

您应该在<$ c中定义 servlet-mapping $ c> web.xml 像这样:

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

然后将 url-pattern 添加到服务器根URL:

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

这篇关于IntelliJ Idea:将一个简单的Java servlet(无JSP)部署到Tomcat 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆