<%@ 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> <% //out.write(session.toString()+" "+session.isNew()); if(session==null){ out.write("session not creat"); } else if(session.getAttribute("name")==null||session.getAttribute("name").equals("")){ out.write("<a href='login.jsp'>登录</a>"); } else{ out.write(session.getAttribute("name")+"你好"); } %> / <a href="index.jsp" onclick="logout()">注销</a> <script type="text/javascript"> function logout(){ <% session.invalidate(); %> } </script> </body> </html>
相关文章:
- 使用org.apache.jasper.JspC编译jsp文件--转载 2022-12-23
- Jsp编译后生成的Java文件位置 2021-09-13
- Idea 编译jsp生成的class文件路径 2022-12-23
- Weblogic编译JSP后生成的class文件的位置 2021-06-04
- jsp 预编译 2022-12-23
- Tomcat编译jsp生成Servlet文件的存放位置 2021-07-29
- eclipse 使用 maven 无法编译 jsp 文件的问题 2022-12-23