Struts原理與實踐(2)

2021-03-31 08:56:29 字數 704 閱讀 3996

struts原理與實踐(2)

<%@ taglib uri="/web-inf/struts-bean.tld" prefix="bean" %>

<%@ taglib uri="/web-inf/struts-html.tld" prefix="html" %>

main.jsp的**清單如下:

<%@ page contenttype="text/html; charset=utf-8" %>

<%@ taglib uri="/web-inf/struts-bean.tld" prefix="bean" %>

<%@ taglib uri="/web-inf/struts-logic.tld" prefix="logic" %>

首先,我們看一下logon.jsp檔案,會發現它有這麼兩個鮮明的特點:一是檔案頭部有諸如:

<%@ taglib uri="/web-inf/struts-bean.tld" prefix="bean" %>

<%@ taglib uri="/web-inf/struts-html.tld" prefix="html" %>

這樣的指令**,他們的作用就是指示頁面要用到struts的自定義標籤,標籤庫uri是乙個邏輯引用,標籤庫的描述符(tld)的位置在web.xml檔案中給出,見上篇文章的配置部分。struts的標籤庫主要由四組標籤組成,它們分別是:

Struts原理與實踐(2)

page contenttype text html charset utf 8 taglib uri web inf struts bean.tld prefix bean taglib uri web inf struts html.tld prefix html html head title...

Struts原理與實踐(2)

page contenttype text html charset utf 8 taglib uri web inf struts bean.tld prefix bean taglib uri web inf struts html.tld prefix html html head title...

Struts原理與實踐(2)

taglib uri web inf struts bean.tld prefix bean taglib uri web inf struts html.tld prefix html main.jsp的 清單如下 page contenttype text html charset utf 8 ...