宝哥软件园

JSP中参数动作的实例详解

编辑:宝哥软件园 来源:互联网 时间:2021-09-03

JSP中参数动作的实例详解

一语法

jsp:param名称='参数名值='参数值'

常常与JSP :转发一起使用,作为其子标签存在。

二代码

1、login.jsp

“% @”页面语言=“Java”导入=“Java”。乌提尔。*“ContentType=”文本/html;charset=utf-8 " % % String path=request。GetContextPath();字符串基本路径=请求。getscheme()' ://'请求。getservername()“:”请求。getserverport()“路径”/;% !DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN ' HTML head base href=' %=base path % ' rel=' external no follow ' rel=' external no follow ' rel=' external no follow ' title my JSP '登录。“JSP”起始页/title meta http-equiv=' pragma ' content=' no-cache ' meta http-equiv=' cache-control ' content=' no-cache ' meta http-equiv=' expires ' content=' 0 ' meta-link rel='样式表type=' text/CSS ' href=' style。CSS ' rel='外部nofollow ' rel='外部nofollow ' rel='外部nofollow '-/头体h1系统登录/h1小时表单名称='登录信息'操作='dologin.jsp '方法='post '表tr td用户名:/TD TD输入类型=' text '名称=' username '/TD/tr TD密码:/TD TD TD输入类型=' password ' name=' password '/TD/tr TD colspan=' 2 '输入类型=' submit ' value='登录//td /tr /table /form /body/html2、dologin.jsp

“% @”页面语言=“Java”导入=“Java”。乌提尔。*“ContentType=”文本/html;charset=utf-8 " % % String path=request。GetContextPath();字符串基本路径=请求。getscheme()' ://'请求。getservername()“:”请求。getserverport()“路径”/;% !DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN ' HTML head base href=' %=base path % ' rel=' external no follow ' rel=' external no follow ' rel=' external no follow ' title my JSP ' dolo gin。“JSP”起始页/title meta http-equiv=' pragma ' content=' no-cache ' meta http-equiv=' cache-control ' content=' no-cache ' meta http-equiv=' expires ' content=' 0 '-link rel='样式表type=' text/CSS ' href=' style。CSS ' rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow '-/head body JSP : forward page=' user。JSP ' JSP : param值='[email protected]' name=' email '/JSP 3360 param值=' 88888888 ' name=' password '/JSP : forward/body/html 3,用户.

“% @”页面语言=“Java”导入=“Java”。乌提尔。*“ContentType=”文本/html;charset=utf-8 " % % String path=request。GetContextPath();字符串基本路径=请求。getscheme()' ://'请求。getservername()“:”请求。getserverport()“路径”/;% !DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN ' HTML head base href=' %=base path % ' rel=' external no follow ' rel=' external no follow ' rel=' external no follow ' title my JSP '用户。“JSP”起始页/title meta http-equiv=' pragma ' content=' no-cache ' meta http-equiv=' cache-control ' content=' no-cache ' meta http-equiv=' expires ' content=' 0 ' meta-link rel='样式表type=' text/CSS ' href=' style。CSS ' rel='外部nofollow ' rel='外部nofollow ' rel='外部nofollow '-/头体h1用户资料/h1 HR %请求。setcharacter encoding(' utf-8 ');字符串用户名=' ';字符串密码=' ';字符串电子邮件=' ';if(请求。GetParameter(' username ')!=null){ username=request。GetParameter(' username ');} if(请求。GetParameter('密码')!=null){密码=请求。GetParameter('密码');} if(请求。GetParameter(' email ')!=null){ email=request。GetParameter(' email ');} % 用户名:%=用户名%br密码:%=密码%br电子邮箱:%=电子邮件% br/正文/html三运行结果

如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

更多资讯
游戏推荐
更多+