1 package net.simya.ldap.taglib; 2 3 import javax.servlet.jsp.tagext.*; 4 import javax.servlet.jsp.*; 5 import javax.naming.NamingException ; 6 import net.simya.ldap.beans.*; 7 8 public class Delete 9 extends TagSupport 10 { 11 private String dn = null; 12 13 public int doStartTag() 14 throws JspException 15 { 16 Connect connectTag = (Connect) getParent(); 17 if ( connectTag == null ) 18 throw new JspTagException( "<delete> tag should be child node of <connect> tag." ); 19 20 LdapDeleteEntryBean deleteBean = new LdapDeleteEntryBean(); 21 deleteBean.setDn( dn ); 22 deleteBean.setContext( connectTag.getContext() ); 23 try 24 { 25 deleteBean.deleteEntry(); 26 } catch ( NamingException ex ) 27 { 28 throw new LdapTaglibException( ex ); 29 } 30 return EVAL_PAGE; 31 } 32 33 public void release() 34 { 35 dn = null; 36 } 37 38 public String getDn() { return this.dn; } 39 public void setDn(String dn) { this.dn = dn; } 40 } | Popular Tags |