1.配置环境,从tomcat的lib下面引入servlet-api.jar包。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASkAAACICAIAAAA0zIoqAAAWwklEQVR4nO2dW3ATV5rH9cDLPukhtTPU7hocHC5OllQxJEAEiATCJWxmyUzIkNua7ACahy2ywNSOXUtKJZhQ5RiSlSEEkwmWuDi2A2zZsKhsYyPbMcIEF9gGGxEFS8YQG2wT24AtCOTsQ8vS6e5z+iIddbfs71enwGp1n77+9Z0+fb5/mw5Utv3j3N8P8HG73ZUtdypb7iA5Nm7cKDsPQmjzpj3H2h4d80uVzZv20Cvw2Ew2j3BKBIszwE0KOC2j02webIbYHNTaAEAeThRutxtXCvfVgAIEtZkS1J5C/mjbX3wpXHwpXHwxfPgSoRRfDG/Y8CW9AoFaPDa+4mye2P8YhEmChQFAOcbSHhf3pP9FCL2VVehufOC+8MDd+KCQWL57sDqrkL4evvawkIYFNm4qLiuC9jw2E8Q8ID6Sob03kx33XnunaL93cL93cF/tIPeHuLz+7hF6BSLtUSMX1/DkvhZqD4QHJIKxtKfwfs/65je7K/uly6Lfl9IrELc5Y589NpsHIRRwOiNTopLDtRdwWqCpCSSEsbSnkBd+e/yz/7v9Wdntz8puf1pOKp7bL7x+nF6BqHeE368SnUkwKTKXxRkQNlNBhoBqjKU9hXFv5oqy3KPded905x7tzjvenXu0O7e8O7e8O/dod3T6Py8tV3ssAEBLjKU9hbz1n03Tl56ULaxWBwDJgLX2qtr+aV7S4x4AjAGSob2kP98DgDEAe+2lJaA9iHvA+IGx9gqr2tJegrgHAPKw1t7ptskWiHsAIA9j7blOt6UnoD0AGD8kQ3u/0yvuBYNeu8tldXntLlcw6E2kKgBINoy1565ue3p+/NpLhGDQa/V6s7ze2tpat/uI1eUF+QFGhr32pszX6H6v5XhOtCCE7F5vlsvr8rq8QbvX68qye7PsLuW1yUFOIAKAuGGsvYPVbRkLtLjfaz6Ww/+YbXV5a2trvd4su8tqd1mtdqs1yyVYSpB5IBgQLTk+GrQHMI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rOVWJqzzf5cc2O2OR6/Fp1RrJn4xMUO9us36gMKIsTdZxz3Dp8LZiw1aB6DZ03G5byVguJZk1HT5G/MNjdmm3+s35P853tsUXpJC+OQDiQ+oCfgtFD6QlMAwu4nHvd4ubOHfcEpemhPyXjOsuVPEcu2gnJOe6FTW5O3hclBgfbGkrML1sxLKeGRYTyu5ZAvmP6qQeNefBg77gEpDONxLQd10h7k7wEpB+O4d9AXTB9bPmUmA5gLwL9j8l/Gce+QTtqDuAekHIzj3mFfx9NLjP6+dQAwAozjXpHvh4wl70LcAwBZGMe9Yl9g2pK3Ie4BgCxs497/A2Td+ng2Xn98AAAAAElFTkSuQmCC" alt="" />

2.创建servlet

方法一,通过继承servlet接口

package com.test;
import javax.servlet.*; import java.io.*; public class Login implements Servlet{
//销毁servlet实例,释放内存,在以下情况被调用:关闭应用,重启,关机才被调用
public void destroy() {
System.out.println("destroy"); //检验
}
//得到servlet的配置文件
public ServletConfig getServletConfig() {
return null;
} public String getServletInfo() {
return null;
}
// 用于初始化servlet(类似于类的构造函数),只会被调用一次(用户第一次访问该servlet时被调用)
public void init(ServletConfig arg0) throws ServletException {
System.out.println("init"); //检验
}
//用于处理业务逻辑,每次访问该servlet都会被调用
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
System.out.println("service"); //检验
PrintWriter pw=res.getWriter();
pw.println("hello world!!!");
}
}

3.部署

配置xml文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list> <!-- 需要添加的代码 -->
<servlet>
<!-- 给你的servlet取名,任意的-->
<servlet-name>hello</servlet-name>
<!-- 指明servlet的路径,包名.类名 -->
<servlet-class>com.test.login</servlet-class>
</servlet> <servlet-mapping>
<servlet-name>hello</servlet-name>
<!-- 访问servlet的URL,任意的-->
<url-pattern>/login</url-pattern>
</servlet-mapping>
</web-app>

在浏览器中输入http://IP:port/项目名/login,即可访问,(一般情况下是项目名,当然也可以在tomcat的webapps下改掉项目的名字)

方法二,通过继承GenericServlet实现

package com.test;
import javax.servlet.*;
import javax.servlet.GenericServlet;
import java.io.*; public class Login extends GenericServlet{
//重写service方法即可
public void service (ServletRequest re,ServletResponse res){
try {
PrintWriter pw=res.getWriter();
pw.println("Hello Generic");
} catch (Exception e) {
e.printStackTrace();
}
}
}

方法三,通过继承HttpServlet

表单提交数据get和post的区别:

1.从安全性看:get<post;get提交的数据会在地址栏上显示

2.从提交内容看:get<post;get提交的数据不能大于2K,而post不受限制,不过建议不要大于64K

3.从相应速度来看:get>post,get要求服务器立即处理请求,而post可能形成队列请求。

综合来说,建议使用post

package com.test;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*; public class Login extends HttpServlet{
//处理get请求
public void doGet(HttpServletRequest re,HttpServletResponse rs){
try {
PrintWriter pw=rs.getWriter();
pw.println("hello,HttpServlet");
} catch (Exception e) {
e.printStackTrace();
}
} //处理post请求
public void doPost(HttpServletRequest re,HttpServletResponse rs){
this.doGet(re, rs);
}
}

Serlvet学习笔记之一 ——实现servlet的3种方法的更多相关文章

  1. LINUX编程学习笔记(十三) 遍历目录的两种方法

    1 默认情况下  实际用户和有效用户是一样的 实际用户:执行用户   有效用户:权限用户 getuid()  实际用户 geteuid() 有效用户 chmod u+s 之后 ,其他人执行文件时,实际 ...

  2. 【C语言学习笔记】字符串拼接的3种方法 .

    昨天晚上和@buptpatriot讨论函数返回指针(malloc生成的)的问题,提到字符串拼接,做个总结. #include<stdio.h> #include<stdlib.h&g ...

  3. OpenTK学习笔记(2)-工作窗口的三种方法创建方法(winfrom窗体控件形式创建)

    参考资料: https://social.msdn.microsoft.com/Forums/zh-TW/1b781685-c670-4338-953d-1957a8f24a66/opentkglco ...

  4. OpenTK学习笔记(2)-工作窗口的三种方法创建方法(winfrom下类的形式创建)

    参考资料: https://www.codeproject.com/Articles/1167212/OpenGL-with-OpenTK-in-Csharp-Part-Initialize-the- ...

  5. OpenTK学习笔记(2)-工作窗口的三种方法创建方法(控制台)

    参考资料: 控制台下类的形式创建:http://www.cnblogs.com/podolski/p/7406628.html 总结: 一.控制台下类的形式创建 1.新建控制台应用 2.连网执行Nug ...

  6. C语言学习笔记之字符串拼接的2种方法——strcat、sprintf

    本文为原创文章,转载请标明出处 1. 使用strcat进行字符串拼接 #include <stdio.h> #include <stdlib.h> #include <s ...

  7. vue学习笔记之:为何data是一个方法

    vue学习笔记之:为何data是一个方法 在vue开发中,我们可以发现,data中的属性值是在function中return出来的.可为何data必须是一个函数呢?我们先看官方的解释: 当一个组件被定 ...

  8. [原创]java WEB学习笔记47:Servlet 监听器简介, ServletContext(Application 对象), HttpSession (Session 对象), HttpServletRequest (request 对象) 监听器,利用listener理解 三个对象的生命周期

    本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...

  9. [原创]java WEB学习笔记05:Servlet中的ServletConfig对象

    本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...

随机推荐

  1. 获取Django中model字段名 字段的verbose_name

    obj._meta.fields 为关键 obj为model类 推荐使用函数 from django.apps import apps def getmodelfield(appname,modeln ...

  2. openldap 备份与导入 及相关问题

    摘要: 对openldap进行备份时,直接使用slapcat命令进行备份,使用ldapadd还原出现问题及解决. 介绍: 对openldap进行备份时,直接使用slapcat命令进行备份(如代码一), ...

  3. sql添加自动增长列

    alter table a add num int identity

  4. centos6.5中的cron计划任务配置方法

    1.#crontab -u <-l, -r, -e> -u指定一个用户-l列出某个用户的任务计划-r删除某个用户的任务-e编辑某个用户的任务 2. cron文件语法与写法 可用cronta ...

  5. list集合绑定在datagridview上时如何实现排序

    List<Person> lst = new List<Person>(); lst.Add(new Person("A", "1")) ...

  6. 【C#】POST请求参数含中文,服务器解析得到乱码

    问题:POST请求参数含有中文,已将含中文的string以UTF-8编码格式转为byte[],并写入到请求流中,但服务器收到数据后以UTF-8解码,得到的依然是乱码! 百度到了以下方法,但依然无法解决 ...

  7. 关于pthread_cond_wait使用while循环判断的理解

    在Stevens的<Unix 环境高级编程>中第11章线程关于pthread_cond_wait的介绍中有一个生产者-消费者的例子P311,在进入pthread_cond_wait前使用w ...

  8. Apache HttpComponents 如何在正常结束前中止一个HTTP请求

    package org.apache.http.examples.client; import org.apache.http.HttpEntity; import org.apache.http.H ...

  9. CAS (4) —— CAS浏览器SSO访问顺序图详解(CAS Web Flow Diagram by Example)

    CAS (4) -- CAS浏览器SSO访问顺序图详解(CAS Web Flow Diagram by Example) tomcat版本: tomcat-8.0.29 jdk版本: jdk1.8.0 ...

  10. TCPdump抓包命令详解

    http://starsliao.blog.163.com/blog/static/89048201062333032563/ TCPdump抓包命令 tcpdump是一个用于截取网络分组,并输出分组 ...