⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timetag_1.txt

📁 Begining JSP Web Development外文书籍源代码
💻 TXT
字号:
package com.wrox.ch10;

import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.text.SimpleDateFormat;

public class timeTag extends TagSupport {
  String format = "HH:mm:ss";

  public void setFormat(String newFormat) {
    format = newFormat;
  } 
  public int doEndTag() throws JspException {
    SimpleDateFormat sdf;
    sdf = new SimpleDateFormat(format);
    String time = sdf.format(new java.util.Date());
    try {
      pageContext.getOut().print(time);
    } catch (Exception e) {
      throw new JspException(e.toString());
    } 
    return EVAL_PAGE;
  } 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -