zoukankan      html  css  js  c++  java
  • Java编程——万年历

    //CheckLogin.java
    package com.checkcode.servlet;
    
    import java.io.IOException;  
    import javax.servlet.ServletException; 
    import javax.servlet.http.HttpServlet;  
    import javax.servlet.http.HttpServletRequest; 
    import javax.servlet.http.HttpServletResponse;   
    public class CheckLogin extends HttpServlet 
    {   
        /**    * Constructor of the object.   */   
        public CheckLogin() 
        {   
            super();   
        }    
        /**    * Destruction of the servlet. <br>    */ 
        public void destroy()
        {   
            super.destroy(); 
            // Just puts "destroy" string in log   
            // Put your code here   
        }      
        public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException 
        {      
            String  validatecode1=(String)request.getSession().getAttribute("ValidateCode");   //    
            String validatecode2=request.getParameter("validatecode");   //    
            if(!validatecode1.equals(validatecode2))
            {    //    
                request.setAttribute("message", "验证错误");        
            }
            else
            {     
                request.setAttribute("message", "验证正确");        
            }   //    
            request.getRequestDispatcher("/0login1.jsp").forward(request, response);   
        }      
        public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException 
        {    
            doGet(request,response);      
        }         
        public void init() throws ServletException 
        {   
            // Put your code here     
        }
    }
    //Calendar.html
    <html>
    <head>
    <title>万年历</title>
    </head>
    <body>
    <center>
        <applet code=CalendarApplet.class width=360 height=320>
        </applet>
    </center>
    </body>
    </html>
  • 相关阅读:
    pytest简介
    python @property的用法及含义全面解析
    python的各种推导式(列表推导式、字典推导式、集合推导式)
    python--random库基本介绍
    整理一下python中with的用法
    Python之路:进程、线程
    Python代码风格的良好养成
    Ubuntu 部署Python开发环境
    Python面向对象编程
    Python文件操作
  • 原文地址:https://www.cnblogs.com/liao-pxsoftware15/p/7875852.html
Copyright © 2011-2022 走看看