KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > simya > ldap > taglib > Delete


1 package net.simya.ldap.taglib;
2
3 import javax.servlet.jsp.tagext.*;
4 import javax.servlet.jsp.*;
5 import javax.naming.NamingException JavaDoc;
6 import net.simya.ldap.beans.*;
7
8 public class Delete
9        extends TagSupport
10 {
11     private String JavaDoc 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 JavaDoc 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 JavaDoc getDn() { return this.dn; }
39     public void setDn(String JavaDoc dn) { this.dn = dn; }
40 }
Popular Tags