KickJava   Java API By Example, From Geeks To Geeks.

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


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 ModifyDn
9        extends TagSupport
10 {
11     private String JavaDoc olddn = null;
12     private String JavaDoc newdn = null;
13     
14     public int doStartTag()
15     throws JspException
16     {
17         Connect connectTag = (Connect) getParent();
18         if ( connectTag == null )
19             throw new JspTagException( "<modifydn> tag should be child node of <connect> tag." );
20         
21         LdapModifyDnBean modifydnBean = new LdapModifyDnBean();
22         modifydnBean.setOldDn( olddn );
23         modifydnBean.setNewDn( newdn );
24         modifydnBean.setContext( connectTag.getContext() );
25         try
26         {
27             modifydnBean.modifyDN();
28             
29         } catch ( NamingException JavaDoc ex )
30         {
31             throw new LdapTaglibException( ex );
32         }
33         return EVAL_PAGE;
34     }
35     
36     public void release()
37     {
38         olddn = null;
39         newdn = null;
40     }
41
42     public String JavaDoc getOlddn() { return this.olddn; }
43     public void setOlddn(String JavaDoc olddn) { this.olddn = olddn; }
44
45     public String JavaDoc getNewdn() { return this.newdn; }
46     public void setNewdn(String JavaDoc newdn) { this.newdn = newdn; }
47 }
Popular Tags