0

0

java jsp自定义标签相关介绍

巴扎黑

巴扎黑

发布时间:2017-08-10 15:35:00

|

1925人浏览过

|

来源于php中文网

原创


本文实例讲述了jsp自定义标签用法。分享给大家供大家参考。具体如下:

在JSP中有一种机制,可以让你在JSP页面中插入与HTML类似的标记。本文介绍JSP定制标记的基本概念和构成,以及如何开发和应用JSP定制标记。

什么是标记

使用HTML语言我们可以这样去编辑我们的网页:





1

2

3

4

5

6

7

8

9

10


<code class="xhtml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">HTML>

  <code class="xhtml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">HEAD>

<code class="xhtml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">TITLE>

HELLO WORLD

TITLE>

HEAD>

<code class="xhtml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">BODY>

HELLO WORLD

BODY>

HTML>

在这里我们把,

称为标记。HTML 标记( HTML Markup)是HTML文档的控制语言,用于指定浏览器显示和打印文档的方式.它是用小于号""括起来的短语和符号,如 、等。许多HTMl标记以成对的方式出现,如 等。在JSP中我们也可以定制自己的标记,以供JSP页面使用,如下例所示





1

2

3

4

5

6

7

8

9

10

11


<code class="java string" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:auto!important; color:blue!important">"/tlds/taglib.tld"prefix="tagclass"%>

 

<title>login</title>

 

 

  <login width="</code"><code class="java string" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:auto!important; color:blue!important">"200"height="100">

 

在上例中就是一个JSP定制标记符。widtht、height是这个标记的属性。是一个标记库定义指令,在稍后我们将会讨论。在JSP中定制标记符,实质上就是以标记的形式封装了一个俱有独立功能的Java类。标记的使用减少了直接嵌入JSP页面的Java代码,方便了页面的布局,并且有利于代码的复用,提高了开发的效率。

JSP服务器解析标记的过程

那么当一个标记被嵌入JSP页面后,JSP服务器是如何对这个标记进行解析的呢?各对象的含义如下所示:

Client: 表示客户端。
JSP-Server:JSP服务器。
JSP-Page:JSP页面。
TLD:  标记库描述文件,定义标记和标记的各种属性和处理文件等。
TagClass 标记处理程序

当一个用户访问一个JSP页面时,这个请求被发送到JSP服务器,JSP服务器会根据这个请求去调用相应的页面,如果这个页面中有自定义的标记, JSP服务就会根据页面指令去访问TLD得到处理程序的相关信息,接着调用该处理程序的构造器方法,启动标记符处理程序,并读取标记符的属性和相应值。对每个没有设置属性的,调用相应的set方法。当标记符第一次使用时,它的任何属性都不会做过设置,因此对每个属性都调用set方法。属性设置完以后,JSP服务器调用处理程序的doStartTag(),然后再调用doEndTag()方法。最后JSP服务器会继续处理剩下的页面,在页面结尾调用release ()方法,清理占用的所有资源。

TLD文件

TLD(TLD:Tag Library Descriptor标记库描述符)文件,标准的XML格式的标记定义文件,被用来存放标记符的信息,下面就是一个典型的TLD文件。





1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40


xmlversion="1.0"encoding="ISO-8859-1"?>

/code>

PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

 "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">taglib>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">tlibversion>1.0tlibversion>

 

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">jspversion>1.1jspversion>

 

 <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">shortname>tagclassshortname>

 

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">tag>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">name>loginname>

  

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">tagclass>

tagclass.login.login

tagclass>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">info>

   

  info>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">attribute>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">name>heightname>

    

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">required>truerequired>

    

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">rtexprvalue>truertexprvalue>

  attribute>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">attribute>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">name>widthname>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">required>truerequired>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">rtexprvalue>truertexprvalue>

  attribute>

tag>

taglib>

在这个TLD文件中定义了只有一个标记符的标记符库,这个名为login的标记符会调用一个Applet以验证用户的合法性。处理这个标记的类就是 tagclass.login.login。width、height是这个标记的两个属性。属性是在使用标记符时作为参数发送的值。我们可以在上面的示例中增加几个标记,也可以为每个标记添加几个属性。我们开发标记符库时不一定非要从头开始,自己编写一个全新TLD。我们可以使用某个集成的开发的环境,也可以修改上面的例子。

TagLib指令

那么当JSP服务器在解析一个标记符时,它是如何定义一个标记库的呢?这就是TagLib指令的主要责任。

Taglib 指令

定义一个标记库以及其自定义标记的前缀.

JSP 语法


复制代码代码如下:


例子






1

2

3

4

5

6

7

8

9

10


<code class="java string" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:auto!important; color:blue!important">"/tlds/taglib.tld"prefix="tagclass"%>

 

<title>login</title>

 

 

  <login width="</code"><code class="java string" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:auto!important; color:blue!important">"200"height="100">

 

描述

指令声明此JSP文件使用了自定义的标记,同时引用标记库,
也指定了他们的标记的前缀。 你必须在使用自定义标记之前使用指令。

属性

uri="URIToTagLibrary" :Uniform Resource Identifier (URI)根据标记的前缀对自定义的标记进行唯一的命名,URI可以是一个相对或绝对的路径。 
  prefix="tagPrefix":在自定义标记之前的前缀。如上例中的

标记符的处理程序(Tag handle)

我们还是以一个例子来看下如何实现一个Tag handle。首先是看一下它的类图:
让我们再看一下它的代码:





1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49


packagetagclass.login;

importjavax.servlet.jsp.tagext.TagSupport;

importjavax.servlet.jsp.*;

importjava.io.*;

publicclassloginextendsTagSupport

{

publiclogin()

{

super();

}

publicintdoStartTag()throwsJspTagException

{

JspWriter out = pageContext.getOut();

try

{

out.println("<applet codebase="applet/login/" code="login.class" width="200" height="100"> </applet>");

}

catch(Exception e)

{

}

returnSKIP_BODY;

}

publiccintdoEndTag()throwsJsptagException

{

returnEVAL_PAGE;

}

publicvoidrelease()

{

super.release();

}

publicvoidsetWidth(String language)

{

this.width = width;

}

publicString getWidth()

{

returnthis.width;

}

publicvoidsetHeight(String height)

{

this.height=height;

}

publicString getHeight()

{

returnthis.height;

}

privateString width;

privateString height;

}

从以上我们可以看出,实现一个简单的标记符处理程序有几个要求:①增加一个类,使之继承 java.Servlet.jsp.tagext.TagSupport类。这个类提供了java.Servlet.jsp.tagext.Tag接口所要求的所有的方法。另外,还需要使用一些基本的API,使JSP容器能够调用我们自己提供的标记符处理程序。②必须为每个标记符属性分别创建一个 get和set方法,JSP容器需要使用这些方法处理程序传递参数。③要为标记符处理程序创建一个构造器和自毁器。JSP需要使用构造器启动处理程序。自毁器是在realease()方法中定义的。在处理程序的生命周期结束时,需要调用自毁器释放所占用的资源。④创建两个名为doStartTag()和doEndTag()的方法,执行具体的处理和输出动作。这两个方法是在处理自定义标记符的起始位置和结束位置调用的。它们的返回值是在Tag Interface里定义的静态int,这几个静态值分别是:

SKIP_BODY隐含0 :跳过了开始和结束标签之间的代码。
EVAL_BODY_INCLUDE隐含1:将body的内容输出到存在的输出流中
SKIP_PAGE隐含5 : 忽略剩下的页面。
EVAL_PAGE隐含6:继续执行下面的页

当然标记符也有它自己的缺点。很不方便的封装过程,有限的功能。对于一些不太复杂和功能单一的逻辑描述,需要传递的参数要求不高时,使用JSP标记,要方便的多。对于大多数的商业逻辑应用,还是使用bean要好的多,也宜于servlet控制。

附:文章中所用示例的完整代码

JSP代码:login.jsp





1

2

3

4

5

6

7

8

9

10


<code class="java string" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:auto!important; color:blue!important">"/tlds/taglib.tld"prefix="tagclass"%>

<title></title>

<login width="</code"><code class="java string" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:auto!important; color:blue!important">"200"height="100">

标记符描述库:taglib.tld





1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27


xmlversion="1.0"encoding="ISO-8859-1"?>

/code>

PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

 "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">taglib>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">tlibversion>1.0tlibversion>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">jspversion>1.1jspversion>

 <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">shortname>tagclassshortname>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">tag>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">name>loginname>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">tagclass>

tagclass.login.login

tagclass>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">info>

  info>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">attribute>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">name>heightname>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">required>truerequired>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">rtexprvalue>truertexprvalue>

  attribute>

<code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">attribute>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">name>widthname>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">required>truerequired>

  <code class="xml keyword" style="margin:3px auto 0px; padding:0px 0px 0px 5px; border-left-width:3px; border-left-style:solid; border-left-color:rgb(108,226,108); line-height:20px; width:640px; clear:both; border-top-width:0px!important; border-right-width:0px!important; border-bottom-width:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; font-weight:bold!important; min-height:auto!important; color:rgb(0,102,153)!important">rtexprvalue>truertexprvalue>

  attribute>

tag>

taglib>

标记符处理程序:login.java





1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49


packagetagclass.login;

importjavax.servlet.jsp.tagext.TagSupport;

importjavax.servlet.jsp.*;

importjava.io.*;

publicclassloginextendsTagSupport

{

publiclogin()

{

super();

}

publicintdoStartTag()throwsJspTagException

{

JspWriter out = pageContext.getOut();

try

{

out.println("<applet codebase="applet/login/" code="login.class" width="200" height="100"> </applet>");

}

catch(Exception e)

{

}

returnSKIP_BODY;

}

publiccintdoEndTag()throwsJsptagException

{

returnEVAL_PAGE;

}

publicvoidrelease()

{

super.release();

}

publicvoidsetWidth(String language)

{

this.width = width;

}

publicString getWidth()

{

returnthis.width;

}

publicvoidsetHeight(String height)

{

this.height=height;

}

publicString getHeight()

{

returnthis.height;

}

privateString width;

privateString height;

}

标记符处理程序中所使用的Applet : login.java





1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50


importjava.awt.*;

importjava.awt.event.*;

importjava.applet.*;

publicclassloginextendsAppletimplementsActionListener

{

privateString s_username;

privateString s_userpassword;

privateButton b_ok;

privateButton b_register;

privateLabel l_username;

privateLabel l_userpassword;

privateTextField t_username;

privateTextField t_userpassword;

privateGridLayout g_gridlayout;

publicvoidinit()

{

b_ok=newButton("ok");

b_register=newButton("register");

l_username=newLabel("name");

l_userpassword=newLabel("password");

t_username=newTextField();

t_userpassword=newTextField();

b_ok.addActionListener(this);

b_register.addActionListener(this);

g_gridlayout=newGridLayout(3,2,10,10);

this.setLayout(g_gridlayout);

//this.setBackground(Color.blue);

add(l_username);

add(t_username);

add(l_userpassword);

add(t_userpassword);

add(b_ok);

add(b_register);

}

publicvoidactionPerformed(ActionEvent ev)

{

String s_label=ev.getActionCommand();

if(s_label.equals("ok"))

{

t_username.setText("name");

}

if(s_label.equals("register"))

{

t_userpassword.setText("password");

}

}

publicvoidpaint(Graphics g)

{

}

}

例子:

es.tld文件


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "web-jsptaglibrary_1_2.dtd" >
<taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>es</short-name>

    <tag>
        <name>hasPermission</name>
        <tag-class>com.jfit.core.tag.HasPermissionTag</tag-class>
        <body-content>JSP</body-content>
        <description>
        </description>
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>false</rtexprvalue>
            <description>资源编码,多个之间以“;”分割.</description>
        </attribute>
    </tag>

    <tag>
        <name>lacksPermission</name>
        <tag-class>com.jfit.core.tag.LacksPermissionTag</tag-class>
        <body-content>JSP</body-content>
        <description>
        </description>
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>false</rtexprvalue>
            <description>资源编码,多个之间以“;”分割.</description>
        </attribute>
    </tag>

    <tag>
        <name>hasRole</name>
        <tag-class>com.jfit.core.tag.HasRoleTag</tag-class>
        <body-content>JSP</body-content>
        <description>
        </description>
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>false</rtexprvalue>
            <description>角色编码,多个之间以“;”分割.</description>
        </attribute>
    </tag>

    <tag>
        <name>lacksRole</name>
        <tag-class>com.jfit.core.tag.LacksRoleTag</tag-class>
        <body-content>JSP</body-content>
        <description>
        </description>
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>false</rtexprvalue>
            <description>角色编码,多个之间以“;”分割.</description>
        </attribute>
    </tag>

    <tag>
        <name>isAdmin</name>
        <tag-class>com.jfit.core.tag.IsAdminTag</tag-class>
        <body-content>JSP</body-content>
        <description>
        </description>
    </tag>
    <tag>
        <name>lacksAdmin</name>
        <tag-class>com.jfit.core.tag.LacksAdminTag</tag-class>
        <body-content>JSP</body-content>
        <description>
        </description>
    </tag>


    <tag>
        <name>operation</name>
        <tag-class>com.jfit.core.tag.OperatiuonTag</tag-class>
        <body-content>empty</body-content>
        <attribute>
            <name>name</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>method</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>permission</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>type</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>iconCls</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>plain</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>imgSrc</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>

    </tag>


    <tag>
        <name>dictionary</name>
        <tag-class>com.jfit.core.tag.DictionaryTag</tag-class>
        <body-content>empty</body-content>
        <attribute>
            <name>id</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>name</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>width</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>height</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>code</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>type</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
            <description>可选“combobox”、“combotree”.</description>
        </attribute>
        <attribute>
            <name>selectType</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
            <description>可选“select”、“all”.</description>
        </attribute>
        <attribute>
            <name>required</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>missingMessage</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>value</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>validType</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>multiple</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>editable</name>
            <required>false</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
    </tag>


</taglib>


web.xml


    <!--标签tag-->
    <jsp-config>
        <taglib>
            <taglib-uri>/essh-tags</taglib-uri>
            <taglib-location>/WEB-INF/tlds/es.tld</taglib-location>
        </taglib>
    </jsp-config>


其中一个标签类

cqcms通用企业建站(PC+wap)2.9
cqcms通用企业建站(PC+wap)2.9

cqcms通用企业建站介绍 苍穹企业网站管理系统(CQCMS)软件是国产PHP网站内容管理系统:CQcms内容管理系统 ,它将成为您轻松建站的利器。模板全部使用文件形式保存,对用户设计模板、网站升级转移均提供很大的便利,健壮的模板标签为站长DIY自己的网站提供了强有力的支持。MVC框架,自定义标签,模板文件修改非常方便,PC+WAP响应式布局,一个域名,自动识别终端,一个后台同时管理PC和wap。

下载


public class IsAdminTag extends TagSupport {

    @Override
    public int doStartTag() throws JspException {
        if (SecurityUtils.isCurrentUserAdmin()) {
            return TagSupport.EVAL_BODY_INCLUDE;
        }
        return SKIP_BODY;
    }

}


JSP页面使用

立即学习Java免费学习笔记(深入)”;


<%@ taglib prefix="e" uri="/essh-tags" %>
                    <e:isAdmin>
						<c:choose>
						<c:when test="${content.mode eq 'reply' || content.mode eq 'reject'}">
							<a href="${ctxAdmin}/labor/meetingProposal/form?id=${content.id}">查看</a>
						</c:when>
						<c:otherwise>
						<a href="${ctxAdmin}/labor/meetingProposal/audit?id=${content.id}">审核审批答复</a>
						</c:otherwise>
						</c:choose>
		 </e:isAdmin>


相关文章

java速学教程(入门到精通)
java速学教程(入门到精通)

java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

相关标签:

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法
pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法

本专题系统整理pixiv网页版官网入口及登录访问方式,涵盖官网登录页面直达路径、在线阅读入口及快速进入方法说明,帮助用户高效找到pixiv官方网站,实现便捷、安全的网页端浏览与账号登录体验。

616

2026.02.13

微博网页版主页入口与登录指南_官方网页端快速访问方法
微博网页版主页入口与登录指南_官方网页端快速访问方法

本专题系统整理微博网页版官方入口及网页端登录方式,涵盖首页直达地址、账号登录流程与常见访问问题说明,帮助用户快速找到微博官网主页,实现便捷、安全的网页端登录与内容浏览体验。

194

2026.02.13

Flutter跨平台开发与状态管理实战
Flutter跨平台开发与状态管理实战

本专题围绕Flutter框架展开,系统讲解跨平台UI构建原理与状态管理方案。内容涵盖Widget生命周期、路由管理、Provider与Bloc状态管理模式、网络请求封装及性能优化技巧。通过实战项目演示,帮助开发者构建流畅、可维护的跨平台移动应用。

91

2026.02.13

TypeScript工程化开发与Vite构建优化实践
TypeScript工程化开发与Vite构建优化实践

本专题面向前端开发者,深入讲解 TypeScript 类型系统与大型项目结构设计方法,并结合 Vite 构建工具优化前端工程化流程。内容包括模块化设计、类型声明管理、代码分割、热更新原理以及构建性能调优。通过完整项目示例,帮助开发者提升代码可维护性与开发效率。

20

2026.02.13

Redis高可用架构与分布式缓存实战
Redis高可用架构与分布式缓存实战

本专题围绕 Redis 在高并发系统中的应用展开,系统讲解主从复制、哨兵机制、Cluster 集群模式及数据分片原理。内容涵盖缓存穿透与雪崩解决方案、分布式锁实现、热点数据优化及持久化策略。通过真实业务场景演示,帮助开发者构建高可用、可扩展的分布式缓存系统。

54

2026.02.13

c语言 数据类型
c语言 数据类型

本专题整合了c语言数据类型相关内容,阅读专题下面的文章了解更多详细内容。

29

2026.02.12

雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法
雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法

本专题系统整理雨课堂网页版官方入口及在线登录方式,涵盖账号登录流程、官方直连入口及平台访问方法说明,帮助师生用户快速进入雨课堂在线教学平台,实现便捷、高效的课程学习与教学管理体验。

15

2026.02.12

豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法
豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法

本专题汇总豆包AI官方网页版入口及在线使用方式,涵盖智能写作工具、图片生成体验入口和官网登录方法,帮助用户快速直达豆包AI平台,高效完成文本创作与AI生图任务,实现便捷智能创作体验。

598

2026.02.12

PostgreSQL性能优化与索引调优实战
PostgreSQL性能优化与索引调优实战

本专题面向后端开发与数据库工程师,深入讲解 PostgreSQL 查询优化原理与索引机制。内容包括执行计划分析、常见索引类型对比、慢查询优化策略、事务隔离级别以及高并发场景下的性能调优技巧。通过实战案例解析,帮助开发者提升数据库响应速度与系统稳定性。

56

2026.02.12

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
Kotlin 教程
Kotlin 教程

共23课时 | 3.7万人学习

C# 教程
C# 教程

共94课时 | 9.8万人学习

Java 教程
Java 教程

共578课时 | 68.3万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号