码迷,mamicode.com
首页 > 其他好文 > 详细

servlet简单表单笔记

时间:2018-04-17 15:40:48      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:servlet简单表单笔记

package cn.web.http; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Demo5 extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter pw = response.getWriter(); pw.write("<form method=‘‘ action=‘#‘>"); pw.write(" 用户名: <input type=‘text‘ name=‘username/‘><br/>"); pw.write("密码: <input type=‘password‘ name=‘password/‘><br/>"); pw.write("<select name = ‘role>"); pw.write("<option value=‘普通用户‘>普通用户</option>"); pw.write("<option value=‘超级用户‘>超级用户</option>"); pw.write("</select><br>"); pw.write("<input type=‘submit‘ value = ‘提交‘>"); pw.write("</form>"); } }

技术分享图片

servlet简单表单笔记

标签:servlet简单表单笔记

原文地址:http://blog.51cto.com/357712148/2104403

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!