美文网首页
Servlet处理表单数据

Servlet处理表单数据

作者: 米都都 | 来源:发表于2019-01-07 18:56 被阅读0次
  • html表单

(1) 表单 form

...代表中间包括的下面几种类型元素

<form method="post" action="/servlet/addMessage">
    ....
</form>

(2) 输入框 input(text)

<input type="text" name="username" size="16" maxLength="8" value="liuwei">

(3) 密码 input(password)

<input type="password" name="password" size="20" maxLength="8">

(4) 单选 input(radio)

<input name="gender" type="radio" value="male" checked>男
<input name="gender" type="radio" value="female">女

(5) 多选 input(checkbox)

<input type="checkbox" name="interest" value="movie">看电影
<input type="checkbox" name="interest" value="music">听音乐
<input type="checkbox" name="interest" value="tv">看电视
<input type="checkbox" name="interest" value="sing">唱歌

(6) Select单选 select

<select name="city">
    <option value="Beijing">北京</option>
    <option value="Beijing">天津</option>
    <option value="Beijing">上海</option>
    <option value="Beijing">重庆</option>
    <option value="Beijing">其它</option>
</select>

(7) Select多选 select(multiple)

<select name="city" multiple>
    <option value="Beijing">北京</option>
    <option value="Beijing">天津</option>
    <option value="Beijing">上海</option>
    <option value="Beijing">重庆</option>
    <option value="Beijing">其它</option>
</select>

(8) 文本输入区 textarea

<textarea name="content" rows="10" cols="40">大家好</textarea>

(9) 提交按钮 input(submit)

<input type="submit" name="submit" value="确定">

(10) 重置按钮 input(reset)

<input type="reset" value="重新输入">

相关文章

  • html调用servlet(JDBC在Servlet中的使用)

    html调用servlet(JDBC在Servlet中的使用)(1) 1.页面的数据表单 在使用Servlet处理...

  • Servlet处理表单数据

    当你需要从浏览器到 Web 服务器传递一些信息并最终传回到后台程序时,你一定遇到了许多情况。浏览器使用两种方法向 ...

  • Servlet处理表单数据

    html表单 (1) 表单 form (2) 输入框 input(text) (3) 密码 input(passw...

  • jsp页面的超链请求与表单请求servlet如何处理

    (1)超链请求 产品列表 在servlet处理时使用servlet类中的doGet()方法进行处理。(2)表单请求...

  • Servlet获取表单数据和路径跳转。

    1.Servlet获取表单数据(1)servlet的dopost方法代码: (2)获取填写数据的页面userinf...

  • 重定向

    问题: 如果当前的请求,Servlet 无法进行处理怎么办? 如果使用请求转发,造成表单数据重复提交怎么办? 解决...

  • servlet

    1.servlet主要功能:设置编码字符集,获取表单参数,核心业务处理调用service,带数据,页面跳转 2、s...

  • Servlet 表单数据

    很多情况下,需要传递一些信息,从浏览器到 Web 服务器,最终到后台程序。浏览器使用两种方法可将这些信息传递到 W...

  • Servlet中处理表单提交的数据

    UseServlet.java index.jsp success.jsp

  • 表单 - 提交按钮

    定义用于向表单处理程序(form-handler)提交表单的按钮。表单处理程序通常是包含用来处理输入数据的脚本的服...

网友评论

      本文标题:Servlet处理表单数据

      本文链接:https://www.haomeiwen.com/subject/qmrprqtx.html