社区
Web 开发
帖子详情
Simple example of Servlet
MyPlanet
2002-11-14 09:33:50
I am learning JAVA. Can you tell me where I can find a simple example how to create Servlet and use it in JSP?
...全文
74
4
打赏
收藏
Simple example of Servlet
I am learning JAVA. Can you tell me where I can find a simple example how to create Servlet and use it in JSP?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xuw
2002-11-15
打赏
举报
回复
不知你用什么服务,但用tomcat是最简单的了.
那里有很多例子可用:
http://localhost:8080/examples/servlets/index.html
HawaiiLeo
2002-11-15
打赏
举报
回复
Tomcat 中例子
C:\Tomcat4.1\webapps\examples\servlets
如helloworld.html
=====================================
Source Code for HelloWorld Example
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<head>");
out.println("<title>Hello World!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello World!</h1>");
out.println("</body>");
out.println("</html>");
}
}
alsoran
2002-11-14
打赏
举报
回复
www.servletforum.com
longlink
2002-11-14
打赏
举报
回复
use Tomcat and it will give you some example.
servlet
_
simple
_
example
_loginCl
本文提供了一个简单的HTTP
Servlet
实现的登录验证代码示例,通过获取用户名和密码进行身份验证,并根据验证结果重定向到不同的页面。
servlet
_
simple
_
example
_wel
本教程展示了如何使用Java
Servlet
创建一个简单的Web欢迎页面,包括设置响应类型、内容和基本的输出。
servlet
_
simple
_
example
_login
本文介绍了一个简单的基于Java
Servlet
的登录页面实现方法。通过继承Http
Servlet
类并重写doGet方法来生成HTML登录表单,该表单包含用户名和密码输入框及提交按钮。doPost方法直接调用doGet实现表单提交后的响应。
Simple
Web
Example
本文介绍在 Eclipse 3.7 版本中配置并运行一个简单的
Servlet
的过程,包括必要的 JAR 包及配置详情。
A
Simple
Server3.0
Example
本文深入探讨了
Servlet
3.0的异步化功能,展示了如何通过注解方式简化配置,并实现了基本的异步处理流程。通过构建一个简单的
Servlet
实例,演示了异步请求的处理过程,包括请求发起、远程调用、结果接收和响应构造等关键步骤。同时,介绍了如何正确配置Filter以支持异步操作,并提供了相关错误排查案例。
Web 开发
81,110
社区成员
341,722
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章