JSP自定义标签例子
由于工作需要,最近要做一个WAP网。打算采用 SPRING + HIBERNATE 做 应用层和持久层。
表示层的话,由于没有合适的开源框架,打算改源。准备把Struts 改成 WAPruts。Struts其实控制器其实不用动的,只要改前端表示就行了,而由于表示很多部分是封装好了标签的,所以改Struts也就是主要改标签的展现。
首先就做了个自定义标签的例子备忘记 :
功能:在页面输出
BaseTag.java 所有标签的父类,直接继承了TagSupport,方面功用性能的扩展。
<div style="padding-right: 5.4pt; padding-left: 5.4pt; background: #e6e6e6; padding-bottom: 4px; width: 95%; padding-top: 4px;">http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif/** *//**
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif * @date 2007-7-31
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif */
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gifpackage cn._5znb.j2ee.tag.wap;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gifimport javax.servlet.jsp.tagext.TagSupport;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif/** *//**
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif * @author 唐韧
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif * @date 2007-7-31
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif */
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gifpublic class BaseTag extends TagSupport ...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif /** *//**
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif * @param args
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif */
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif public static void main(String[] args) ...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif // TODO Auto-generated method stub
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif }
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif}
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif
页:
[1]