学习练习 session练习
Posted Clown
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了学习练习 session练习相关的知识,希望对你有一定的参考价值。
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 4 <html> 5 <head> 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7 <title>Insert title here</title> 8 </head> 9 <body> 10 <form action="lianxi2.jsp" method = "post"> 11 <input type = "text" name = "username"> 12 <input type = "submit" value = "登录"> 13 14 </form> 15 </body> 16 </html>
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 4 <html> 5 <head> 6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7 <title>Insert title here</title> 8 </head> 9 <body> 10 <% 11 //接收参数 12 String str = new String(request.getParameter("username").getBytes("ISO-8859-1"),"UTF-8"); 13 14 session.setAttribute("name", str); 15 %> 16 添加了session 17 登录成功 18 </body> 19 </html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <% String str=new String(session.getAttribute("name").toString().getBytes("ISO-8859-1"),"UTF-8"); out.print("用户是"+str); %> </body> </html>
以上是关于学习练习 session练习的主要内容,如果未能解决你的问题,请参考以下文章
我的OpenGL学习进阶之旅NDK开发中find_library查找的系统动态库在哪里?
我的OpenGL学习进阶之旅NDK开发中find_library查找的系统动态库在哪里?
spring练习,在Eclipse搭建的Spring开发环境中,使用set注入方式,实现对象的依赖关系,通过ClassPathXmlApplicationContext实体类获取Bean对象(代码片段