JSP将表单提交并在本页中显示
2024-08-26 01:07:40
代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <!-- 将表单提交并在本页显示 --> <body> <form action="index.jsp" method="post"> 用户登录:<input type="text" name="user" /><br> 密码:<input type="password" name="password"/><br> <input type="submit"> </form> <hr> <% if((request.getParameter("user")!=null)&&(request.getParameter("password")!=null)){ %> 用户参数名为:<%=request.getParameter("user")%><br> 密码为:<%=request.getParameter("password")%> <%} %> </body> </html>
最新文章
- 每天一个linux命令(61):wget命令
- JQuery AJAX 解析获得的JSON数据
- poj1631Bridging signals(最长单调递增子序列 nlgn)
- 几个与时间相关的php的函数
- block iOS 块
- asp.net如何设置数据库连接池的数量
- css3 javascript 实现菜单按钮特效
- Firefly distributed模块的原理与twisted中PB远程调用协议
- 测试最新的log4cplus1.1.2版
- 关于STM32 IAP
- 福州大学软工 1715 | K 班 - 启航
- 容器与Docker简介(一)——微软微服务电子书翻译系列
- 使用Myeclipse为数据表创建hibernate实体对象
- SSH深度历险(四) Maven初步学习
- 第一次使用eclipse出现的问题
- Appium 学习三:Appium-Desktop 填坑
- JavaScript中调皮的undefined
- RocketMQ 部署
- Javascript-Object-Definition
- Delphi for iOS开发指南(7):在iOS应用程序中使用WebBrowser组件
热门文章
- html和css知识总结
- ArcGis 统计方法
- Wordpress 3.5.1的debug流水账
- 理解SQL Server中的权限体系(下)----安全对象和权限
- raid知识
- C语言 文件操作7--文件错误处理
- 添加web引用和添加服务引用有什么区别?
- Eclipse系列: Eclipse设置Tomcat启动超时时间
- [CareerCup] 9.6 Generate Parentheses 生成括号
- [CareerCup] 11.6 Search a 2D Matrix 搜索一个二维矩阵