每日博客
web,数据库,html
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <% String name=request.getParameter("name"); String pwd=request.getParameter("pwd"); if(name!=null&&pwd!=null&&name.equals("jsj")&&pwd.equals("123")){ %> <jsp:forward page="success.jsp"/> <% }else{response.sendRedirect("fail.html");} %> </body> </html>
<% Object oCount = application.getAttribute("count"); Integer count=null; if(oCount==null) { count = new Integer(1); application.setAttribute("count", count); } else { count = (Integer)application.getAttribute("count"); count = new Integer(count.intValue()+1); application.setAttribute("count", count); } %> 这是第<%=count.intValue() %>次登录。
<% Object oCount = application.getAttribute("count"); Integer count=null; if(oCount==null) { count = new Integer(1); application.setAttribute("count", count); } else { count = (Integer)application.getAttribute("count"); count = new Integer(count.intValue()+1); application.setAttribute("count", count); } %> 这是第<%=count.intValue() %>次登录。
<%request.setCharacterEncoding("utf-8");%> <%=(String)session.getAttribute("flag")%>