当前位置: 网站首页 > WEB > jsp

实例讲解JSP Model2体系结构(下)

时间:1970-1-1 08:33:31来源: jsp作者:admin 点击:1次 字体 [ С]

   public void setName(String name) {

     this.name = name;

   }

   public int doStartTag() throws JspException {

     // obtain reference totemplate stack

     Stack stack = (Stack)pageContext.get attribute (

         "template-stack", PageContext.REQUEST_SCOPE);

     // stack should not be null

     if(stack == null)

       throw new JspException("GetTag.doStartTag(): " +

                   "NO STACK");

     // peek at hashtable

     Hashtable params = (Hashtable)stack.peek();

     // hashtable should not be null

     if(params == null)

       throw new JspException("GetTag.doStartTag(): " +

                   "NO HASHTABLE");

     // get page parameter from hashtable

     PageParameter param = (PageParameter)params.get(name);

     if(param != null) {
发表评论
验证码:
最新评论
相关文章
最热文章