• 大小: 7.16MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-22
  • 语言: 其他
  • 标签: Servlet  

资源简介

Servlet编写登录的demo,重点理解Servlet的原理

资源截图

代码片段和文件信息

/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License Version 2.0
* (the “License“); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import java.util.*;
import java.awt.*;
import java.applet.*;
import java.text.*;

/**
 * Time!
 *
 * @author Rachel Gollub
 */

public class Clock2 extends applet implements Runnable {
    Thread timer;                // The thread that displays clock
    int lastxs lastys lastxm
        lastym lastxh lastyh;  // Dimensions used to draw hands 
    SimpleDateFormat formatter;  // Formats the date displayed
    String lastdate;             // String to hold date displayed
    Font clockFaceFont;          // Font for number display on clock
    Date currentDate;            // Used to get date to display
    Color handColor;             // Color of main hands and dial
    Color numberColor;           // Color of second hand and numbers

    public void init() {
        int xy;
        lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0;
        formatter = new SimpleDateFormat (“EEE MMM dd hh:mm:ss yyyy“ Locale.getDefault());
        currentDate = new Date();
        lastdate = formatter.format(currentDate);
        clockFaceFont = new Font(“Serif“ Font.PLAIN 14);
        handColor = Color.blue;
        numberColor = Color.darkGray;

        try {
            setBackground(new Color(Integer.parseInt(getParameter(“bgcolor“)16)));
        } catch (Exception E) { }
        try {
            handColor = new Color(Integer.parseInt(getParameter(“fgcolor1“)16));
        } catch (Exception E) { }
        try {
            numberColor = new Color(Integer.parseInt(getParameter(“fgcolor2“)16));
        } catch (Exception E) { }
        resize(300300);              // Set clock window size
    }

    // Plotpoints allows calculation to only cover 45 degrees of the circle
    // and then mirror
    public void plotpoints(int x0 int y0 int x int y Graphics g) {
        g.drawLine(x0+xy0+yx0+xy0+y);
        g.drawLine(x0+yy0+xx0+yy0+x);
        g.drawLine(x0+yy0-xx0+yy0-x);
        g.drawLine(x0+xy0-yx0+xy0-y);
        g.drawLine(x0-xy0-yx0-xy0-y);
        g.drawLine(x0-yy0-xx0-yy0-x);
        g.drawLine(x0-yy0+xx0-yy0+x);
        g.drawLine(x0-xy0+yx0-xy0+y);
    }

    // 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-07-04 17:32  Login\
     目录           0  2014-07-04 09:59  Login\.metadata\
     文件           0  2014-07-04 09:59  Login\.metadata\.lock
     文件       21882  2014-07-04 15:20  Login\.metadata\.log
     目录           0  2014-07-04 09:59  Login\.metadata\.me_tcat\
     目录           0  2014-07-04 09:59  Login\.metadata\.me_tcat\temp\
     目录           0  2014-07-04 16:33  Login\.metadata\.plugins\
     目录           0  2014-07-04 16:33  Login\.metadata\.plugins\com.genuitec.eclipse.dehory\
     目录           0  2014-07-04 09:59  Login\.metadata\.plugins\com.genuitec.eclipse.easie.tomcat.myeclipse\
     目录           0  2014-07-04 11:11  Login\.metadata\.plugins\com.genuitec.eclipse.hibernate\
     目录           0  2014-07-04 09:59  Login\.metadata\.plugins\com.genuitec.eclipse.sqlexplorer\
     文件         828  2014-07-04 16:33  Login\.metadata\.plugins\com.genuitec.eclipse.sqlexplorer\ConnectionProfiles.xml
     文件       16644  2014-07-04 16:33  Login\.metadata\.plugins\com.genuitec.eclipse.sqlexplorer\SQLDrivers.xml
     目录           0  2014-07-04 10:17  Login\.metadata\.plugins\com.genuitec.eclipse.templates\
     文件        3725  2014-07-04 16:06  Login\.metadata\.plugins\com.genuitec.eclipse.templates\velocity.log
     目录           0  2014-07-04 16:13  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\
     目录           0  2014-07-04 11:14  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\
     文件        2047  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\base.xml
     文件        1989  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\baselabel.xml
     文件        1486  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\blocklabel.xml
     文件         702  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\booleanCheckbox.xml
     文件        1271  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\button.xml
     文件        2889  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\commandButton.xml
     文件        1170  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\containerbase.xml
     文件        1043  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\directionTable.xml
     文件         556  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\emptycontainer.xml
     文件         998  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\graphicImage.xml
     文件        1031  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\hidden.xml
     文件        4082  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\htmlbindings.css
     文件        1534  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\htmlbutton.xml
     文件         801  2014-06-28 14:42  Login\.metadata\.plugins\com.genuitec.eclipse.webdesigner3\bindings\htmlhidden.xml
............此处省略1378个文件信息

评论

共有 条评论