这里只是一个简单的servlet,实际的应用过程中可能需要在其中实现复杂的代码。

jsp servlet之hello world

jsp servlet之hello world

上面是使用eclipse生成类的简单实现。这个类只是重写了httpservlet的doGet方法。代码如下:

2.修改web.xml文件。

3.测试应用程序。

将整个的web程序部署到tomcat中,启动服务器,然后通过下面的连接访问这个servlet:http://localhost:8080/HelloWorldServlet/HelloWorldServlet,在浏览器中应该显示的就是亲切的hello world。

4.遗留的问题。

在web.xml中url-pattern的规则是怎样的?

相关文章:

  • 2021-11-16
  • 2021-11-07
  • 2022-02-01
  • 2021-10-09
  • 2021-07-20
  • 2021-10-04
猜你喜欢
  • 2019-01-19
  • 2022-12-23
  • 2021-07-02
  • 2021-12-19
  • 2021-12-31
  • 2019-09-01
相关资源
相似解决方案